Skip to content

Commit 8c204c3

Browse files
bfullamamitabh94
andcommitted
chore(runway): cherry-pick fix: cp-7.47.0 stop quote polling when "quote expired" modal is open (#15602)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Currently, the "quote expired" modal will open as expected but quotes continue refreshing in the background. This PR stops all polling once the modal opens. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to Solana swap 2. Get quote 3. Wait for quotes to expire 4. See "quotes expired" modal 5. Observe no quotes refreshing in the background ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Amitabh Aggarwal <aggarwal.amitabh@gmail.com>
1 parent b823e60 commit 8c204c3

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6262

6363
### Added
6464

65+
- fix(bridge): prevent quote polling when "quote expired" modal is open ([#15602](https://github.com/MetaMask/metamask-mobile/issues/15602))
6566
- feat(bridge): improve bridge screen layout and user experience ([#15425](https://github.com/MetaMask/metamask-mobile/pull/15425))
6667
- fix(browser): fix browser PermissionsSummary origin spoofing when browser redirects issue ([#13394](https://github.com/MetaMask/metamask-mobile/pull/13394))
6768
- feat: migrate eth_accounts and permittedChains to CAIP-25 endowment ([#13970](https://github.com/MetaMask/metamask-mobile/pull/13970))

app/components/UI/Bridge/components/QuoteExpiredModal/QuoteExpiredModal.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useRef } from 'react';
1+
import React, { useEffect, useRef } from 'react';
22
import { View } from 'react-native';
33
import { useNavigation } from '@react-navigation/native';
44
import { strings } from '../../../../../../locales/i18n';
@@ -53,6 +53,13 @@ const QuoteExpiredModal = () => {
5353
navigation.goBack();
5454
};
5555

56+
useEffect(() => {
57+
// Stop polling when modal opens
58+
if (Engine.context.BridgeController?.stopAllPolling) {
59+
Engine.context.BridgeController.stopAllPolling();
60+
}
61+
}, []);
62+
5663
const footerButtonProps = [
5764
{
5865
label: strings('quote_expired_modal.get_new_quote'),

0 commit comments

Comments
 (0)