Skip to content

Fix Infinite Reloading User Billing Page + Correct Ubuntu Image Alias#48

Merged
jinnaWan merged 2 commits into
mainfrom
CB-fix-bug-2
May 4, 2025
Merged

Fix Infinite Reloading User Billing Page + Correct Ubuntu Image Alias#48
jinnaWan merged 2 commits into
mainfrom
CB-fix-bug-2

Conversation

@jinnaWan
Copy link
Copy Markdown
Collaborator

@jinnaWan jinnaWan commented May 4, 2025

No description provided.

@jinnaWan jinnaWan requested review from Copilot and nut1414 May 4, 2025 09:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jinnaWan
Copy link
Copy Markdown
Collaborator Author

jinnaWan commented May 4, 2025

@nut1414 pls help review

}, [])

// Fetch wallet data when the username changes
useEffect(() => {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you check for admin select user cases for this change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the userName come from url param, this condition(userWallet?.username !== userName) will cover the case.

@jinnaWan jinnaWan merged commit 3381e5b into main May 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants