Skip to content

Refresh "Invested" header balance after investment completes#746

Merged
dangershony merged 1 commit intomainfrom
copilot/update-header-invested-value
Apr 14, 2026
Merged

Refresh "Invested" header balance after investment completes#746
dangershony merged 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.

@dangershony dangershony marked this pull request as ready for review April 14, 2026 13:44
@dangershony dangershony merged commit 70c717b into main Apr 14, 2026
@dangershony dangershony deleted the copilot/update-header-invested-value branch April 14, 2026 13:44
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