diff --git a/CHANGELOG.md b/CHANGELOG.md index c06f7c3e807..541ea7a3d02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - fixed: Swap quote timeout error interrupting user after cancelling a slow swap search - fixed: Disable "Migrate Wallets" button when no assets are available to migrate - fixed: Contacts permission prompt no longer appears on first receive and only shows from transaction-list or payee edit flows +- fixed: Swap KYC terms modal stacking on auto-refresh and accidental dismissal disabling providers ## 4.45.0 (2026-03-10) diff --git a/src/components/modals/SwapVerifyTermsModal.tsx b/src/components/modals/SwapVerifyTermsModal.tsx index 62baa641b90..0879f8eef05 100644 --- a/src/components/modals/SwapVerifyTermsModal.tsx +++ b/src/components/modals/SwapVerifyTermsModal.tsx @@ -111,9 +111,6 @@ const SwapVerifyTermsModal: React.FC = props => { {displayName} } - onCancel={() => { - bridge.resolve(false) - }} > {lstrings.swap_terms_statement} = (props: Props) => { const isFocused = useIsFocused() + const termsCheckPending = React.useRef(false) + const timerExpiredDuringTerms = React.useRef(false) + const pickBestQuoteWithPreference = ( allQuotes: EdgeSwapQuote[] ): EdgeSwapQuote => { @@ -206,6 +209,10 @@ export const SwapConfirmationScene: React.FC = (props: Props) => { const handleExchangeTimerExpired = useHandler(() => { if (!isFocused) return + if (termsCheckPending.current) { + timerExpiredDuringTerms.current = true + return + } navigation.replace('swapProcessing', { swapRequest: selectedQuote.request, @@ -227,12 +234,20 @@ export const SwapConfirmationScene: React.FC = (props: Props) => { const swapConfig = account.swapConfig[pluginId] dispatch(logEvent('Exchange_Shift_Quote')) + termsCheckPending.current = true swapVerifyTerms(swapConfig) .then(async result => { - if (!result) handleExchangeTimerExpired() + termsCheckPending.current = false + if (!result || timerExpiredDuringTerms.current) { + handleExchangeTimerExpired() + } }) .catch((err: unknown) => { + termsCheckPending.current = false showError(err) + if (timerExpiredDuringTerms.current) { + handleExchangeTimerExpired() + } }) })