Fix Infinite Reloading User Billing Page + Correct Ubuntu Image Alias#48
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses two main issues: fixing the infinite reloading on the User Billing page and correcting the Ubuntu image alias in the LXD client. Key changes include replacing a wallet map with a single wallet value in the billing hook and context, updating related billing fetch calls in instance creation, enhancing currency formatting to handle floating‐point precision, and adjusting the image alias logic for Ubuntu.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/hooks/User/useUserBilling.ts | Transitions from a wallet map to a single wallet and updates wallet fetch logic. |
| frontend/src/hooks/Instance/useInstanceCreate.ts | Integrates billing updates post-instance creation by invoking billing overview and transactions. |
| frontend/src/contexts/billingContext.tsx | Updates billing context state to replace the wallet map with a single wallet. |
| frontend/src/constant/CurrencyConstant.ts | Improves currency formatting by handling floating-point precision appropriately. |
| frontend/src/components/User/Billing/OverviewMenu.tsx | Removes redundant billing overview fetch, relying on the hook for data updates. |
| frontend/src/components/User/Billing/HistoryMenu.tsx | Removes redundant transaction fetch in favor of centralized billing hook calls. |
| backend/src/core/service/clients/lxd.py | Adjusts the image alias logic to return the Ubuntu image version rather than a composite alias. |
|
@nut1414 pls help review |
| }, []) | ||
|
|
||
| // Fetch wallet data when the username changes | ||
| useEffect(() => { |
There was a problem hiding this comment.
did you check for admin select user cases for this change?
There was a problem hiding this comment.
yes, the userName come from url param, this condition(userWallet?.username !== userName) will cover the case.
No description provided.