Remove vault change detection logic from deposit flow#1597
Merged
MusabShakeel576 merged 1 commit intoqafrom Mar 8, 2026
Merged
Remove vault change detection logic from deposit flow#1597MusabShakeel576 merged 1 commit intoqafrom
MusabShakeel576 merged 1 commit intoqafrom
Conversation
Remove vault-change useEffects from DepositModalProvider and useDepositOption that were racing with DepositTrigger's handlePress. When navigating from the FUSE vault savings page back to home and clicking "Add funds", handlePress would call selectVaultForDeposit(0) then setModal(OPEN_OPTIONS). After React re-rendered, both useEffects detected the vault name changed (FUSE → USDC) and called resetDepositFlow(), which immediately closed the modal that was just opened. The second click worked because the vault was already 0. These useEffects were redundant — setSelectedVault (used when switching vault tabs in savings) already calls resetDepositFlow(). The useEffects only caught changes from selectVaultForDeposit, where resetting is unwanted since the caller is about to open the modal. https://claude.ai/code/session_01B3ez9b4uMuZFDk5GNZXASA
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
MusabShakeel576
added a commit
that referenced
this pull request
Mar 8, 2026
…-VhAmQ Remove vault change detection logic from deposit flow
MusabShakeel576
added a commit
that referenced
this pull request
Mar 8, 2026
…-cherry-pick-VhAmQ Merge pull request #1597 from Solid-Money/claude/fix-add-funds-button…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR removes duplicate vault change detection logic that was implemented in two separate locations (
DepositModalProvideranduseDepositOption). The logic has been consolidated and simplified by removing the redundant implementations.Key Changes
useEffecthook fromDepositModalProviderthat tracked vault changes usinguseSavingStoreand reset the deposit flow when the selected vault changeduseEffecthook fromuseDepositOptionthat performed the same vault change detection and modal closing logicuseEffect,useReffromDepositModalProvider;useReffromuseDepositOptionresetDepositFlowandsetModalfromuseDepositStoreselection inDepositModalProviderselectedVaultfromuseSavingStoreinDepositModalProviderImplementation Details
The vault change detection logic was previously implemented in two places with nearly identical behavior - tracking the previous vault name and resetting/closing the deposit flow when it changed. This duplication has been removed, likely consolidating the logic elsewhere or simplifying the overall flow management.
https://claude.ai/code/session_01B3ez9b4uMuZFDk5GNZXASA