Skip to content

Refresh "Invested" header balance after investment completes#746

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/update-header-invested-value
Draft

Refresh "Invested" header balance after investment completes#746
Copilot wants to merge 1 commit intomainfrom
copilot/update-header-invested-value

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

The shell header's "Invested" balance stayed stale after a new investment because WalletsUpdated was only fired at the start of the payment flow (before the draft was built), never after the investment was saved to local storage.

Changes

  • InvestPageViewModel.PayWithWalletAsync — fire RefreshBalanceAsync(walletId) after successful submission (both auto-approved and founder-approval paths)
  • InvestPageViewModel.PayViaInvoiceAsync — same fix for the invoice payment path
_logger.LogInformation("Investment flow completed — advancing to Success screen");
_ = _walletContext.RefreshBalanceAsync(walletId);  // triggers WalletsUpdated → LoadTotalInvestedAsync
CurrentScreen = InvestScreen.Success;

RefreshBalanceAsync fires WalletsUpdated, which causes ShellViewModel.LoadTotalInvestedAsync to read the already-updated InvestmentRecordsDocument from local storage and display the correct invested total.

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.

2 participants