From 4aadb3575a90114d70010edfac5088c13d74260b Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Thu, 13 Jun 2024 18:06:07 +0200 Subject: [PATCH] fix: fix token detection modal stuck on firefox (#25279) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Token detection modal seems to stay stuck on firefox [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25279?quickstart=1) ## **Related issues** Fixes: https://github.com/MetaMask/metamask-extension/issues/25256 ## **Manual testing steps** To run locally use: `rm -rf dist && ENABLE_MV3=false yarn && ENABLE_MV3=false yarn build:dev dev --build-type main --lockdown false --snow false --apply-lavamoat false` 1. Import wallet on firefox 2. Got to settings => security and privacy and disable token auto detection 3. Go back to home page and you should see the token detection modal 4. Clicking on allow should dismiss the modal and enable the token detection ## **Screenshots/Recordings** ### **Before** https://github.com/MetaMask/metamask-extension/assets/10994169/e23f59d6-7bc9-4707-872d-436c1a56e7cf ### **After** https://github.com/MetaMask/metamask-extension/assets/10994169/cf47e04c-e5bc-4898-92f1-c80c87988fdb ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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: legobeat <109787230+legobeat@users.noreply.github.com> --- .../app/auto-detect-token/auto-detect-token-modal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/components/app/auto-detect-token/auto-detect-token-modal.tsx b/ui/components/app/auto-detect-token/auto-detect-token-modal.tsx index 27ea2bfcaf70..cf03216ec3ca 100644 --- a/ui/components/app/auto-detect-token/auto-detect-token-modal.tsx +++ b/ui/components/app/auto-detect-token/auto-detect-token-modal.tsx @@ -45,6 +45,7 @@ function AutoDetectTokenModal({ const dispatch = useDispatch(); const trackEvent = useContext(MetaMetricsContext); const { chainId } = useSelector(getProviderConfig); + const locale = useSelector(getCurrentLocale); const handleTokenAutoDetection = useCallback( (val) => { @@ -55,7 +56,7 @@ function AutoDetectTokenModal({ category: MetaMetricsEventCategory.Navigation, properties: { chain_id: chainId, - locale: getCurrentLocale, + locale, referrer: ORIGIN_METAMASK, }, });