Skip to content

fix: update HubCoin balance in UI immediately after purchase#591

Open
Priyanka0205-CSE wants to merge 1 commit into
indresh404:mainfrom
Priyanka0205-CSE:fix/hubcoin-balance-ui-update
Open

fix: update HubCoin balance in UI immediately after purchase#591
Priyanka0205-CSE wants to merge 1 commit into
indresh404:mainfrom
Priyanka0205-CSE:fix/hubcoin-balance-ui-update

Conversation

@Priyanka0205-CSE

Copy link
Copy Markdown
Contributor

Bug

After buying a mascot from the shop, the HubCoin balance
shown in the UI didn't update until the page was reopened.

Root Cause

purchaseMascot in AuthContext.jsx correctly wrote the
deducted balance to Firestore via a transaction, but never
called setUserData to sync the local React state.

Fix

Added setUserData call after the transaction succeeds to
immediately reflect the new coin balance and updated inventory
in the UI without requiring a page reload.

Closes #583

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ranker-hub Ready Ready Preview, Comment Jun 17, 2026 7:29pm

@github-actions github-actions Bot added backend Backend/Firebase related changes bug Something isn't working enhancement New feature or request frontend Frontend related changes (HTML/CSS/JS/React) gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review labels Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend/Firebase related changes bug Something isn't working enhancement New feature or request frontend Frontend related changes (HTML/CSS/JS/React) gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: HubCoin balance doesnt update after buying something from the shop

1 participant