Prevent swap KYC terms modal from stacking and dismiss abuse#5983
Merged
Prevent swap KYC terms modal from stacking and dismiss abuse#5983
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
e4974ae to
e530d96
Compare
samholmes
approved these changes
Mar 30, 2026
Defer the quote auto-refresh timer while the terms modal is pending so a scene remount cannot stack a second modal. Track deferred timer expiry and replay it after the modal resolves to ensure fresh quotes. Make the terms modal non-dismissable (no backdrop tap, swipe, or X button) so the user must explicitly accept or reject. This prevents accidental dismissal from silently disabling the swap provider.
e530d96 to
0a10457
Compare
j0ntz
added a commit
that referenced
this pull request
Mar 31, 2026
j0ntz
added a commit
that referenced
this pull request
Mar 31, 2026
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.

Description
Asana task
Fixes two bugs with the swap KYC terms verification modal:
Stacking modals: When the quote auto-refresh timer expires while the terms modal is open, the scene replaces itself via
SwapProcessingScene, remounts, and callsswapVerifyTermsagain — stacking a duplicate modal on the still-open first one. Fixed by deferring the timer: if it fires while the terms modal is pending, the expiry is recorded and replayed after the modal resolves.Destructive dismissal: Backdrop tap, swipe-down, X button, and hardware back all resolved
false, triggeringchangeEnabled(false)on the swap provider — silently removing it from exchange settings without clear user intent. Fixed by removingonCancelfrom theEdgeModal, making the modal non-dismissable. The user must now explicitly tap Accept or Reject.Closes: https://app.asana.com/1/9976422036640/project/1200972350208303/task/1213613256799799
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have:
Note
Medium Risk
Changes swap confirmation navigation timing and makes the terms modal non-dismissible, which can affect swap quote refresh/timeout behavior and provider enablement in edge cases.
Overview
Fixes swap KYC/terms verification UX by making
SwapVerifyTermsModalnon-cancelable (users must explicitly Accept/Reject) to prevent accidental rejection from backdrop/back actions.Updates
SwapConfirmationSceneto defer the auto-refresh/expiry timer while the terms check is open and replay expiration after the modal resolves, preventing duplicate stacked terms modals during quote refresh.Written by Cursor Bugbot for commit 0a10457. This will update automatically on new commits. Configure here.