Skip to content

Remove vault change detection logic from deposit flow#1597

Merged
MusabShakeel576 merged 1 commit intoqafrom
claude/fix-add-funds-button-VhAmQ
Mar 8, 2026
Merged

Remove vault change detection logic from deposit flow#1597
MusabShakeel576 merged 1 commit intoqafrom
claude/fix-add-funds-button-VhAmQ

Conversation

@MusabShakeel576
Copy link
Copy Markdown
Contributor

Summary

This PR removes duplicate vault change detection logic that was implemented in two separate locations (DepositModalProvider and useDepositOption). The logic has been consolidated and simplified by removing the redundant implementations.

Key Changes

  • Removed useEffect hook from DepositModalProvider that tracked vault changes using useSavingStore and reset the deposit flow when the selected vault changed
  • Removed duplicate useEffect hook from useDepositOption that performed the same vault change detection and modal closing logic
  • Removed unused imports: useEffect, useRef from DepositModalProvider; useRef from useDepositOption
  • Removed unused store selectors: resetDepositFlow and setModal from useDepositStore selection in DepositModalProvider
  • Removed unused store selector: selectedVault from useSavingStore in DepositModalProvider

Implementation 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

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
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 8, 2026

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-app Ignored Ignored Mar 8, 2026 0:15am
solid-app-staging Ignored Ignored Mar 8, 2026 0:15am

Request Review

@MusabShakeel576 MusabShakeel576 merged commit 3c62899 into qa Mar 8, 2026
5 checks passed
@MusabShakeel576 MusabShakeel576 deleted the claude/fix-add-funds-button-VhAmQ branch March 8, 2026 12:15
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…
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