Skip to content

Commit 51a252f

Browse files
runway-github[bot]smgvchaitanyapottigauthierpetetin
authored
release(runway): cherry-pick fix: updated routes for backup srp settings (#38560)
- fix: updated routes for backup srp settings cp-13.12.0 (#38544) <!-- 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** <!-- 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? --> This PR updates the navigation routes in the onboarding flow to track when users access privacy settings from the "Manage default settings" reminder on the wallet creation successful page. The problem was in the onboarding flow redirection logic. Looking at onboarding-flow.tsx: ` useEffect(() => { if (completedOnboarding && !isFromReminder && !openedWithSidepanel) { navigate(DEFAULT_ROUTE); } }, [navigate, completedOnboarding, isFromReminder, openedWithSidepanel]); ` Issue: - When a user already completed onboarding clicks "Manage default settings" on the wallet creation successful page - They would navigate to the Privacy Settings page - BUT the isFromReminder query param was NOT being passed - The onboarding-flow.tsx would detect: - completedOnboarding = true ✅ - isFromReminder = false ❌ (missing!) - This triggered the redirect: navigate(DEFAULT_ROUTE) — kicking users out of the settings flow The Fix: The fix ensures the isFromReminder=true query parameter is: - Added when navigating from "Creation Successful" → "Privacy Settings" - Preserved when navigating from "Privacy Settings" → "Completion Route" Before: Users clicking "Manage default settings" would get unexpectedly redirected away and couldn't complete configuring their privacy settings. After: Users can properly navigate through the "Manage default settings" flow without being kicked out. Jira Link: https://consensyssoftware.atlassian.net/browse/SL-367 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/38544?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/5cd6a3e3-e812-4cb9-be04-e3a06951e6f9 ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Passes and preserves the isFromReminder query param from Creation Successful → Privacy Settings → Completion to prevent unintended redirects. > > - **Onboarding Flow**: > - `ui/pages/onboarding-flow/creation-successful/creation-successful.js`: Update "Manage default settings" button to navigate to `ONBOARDING_PRIVACY_SETTINGS_ROUTE?isFromReminder=true`. > - `ui/pages/onboarding-flow/privacy-settings/privacy-settings.js`: > - Parse `isFromReminder` via `useLocation` and `URLSearchParams`. > - On submit, navigate to `ONBOARDING_COMPLETION_ROUTE` and append `?isFromReminder=true` when present. > - **Changelog**: > - Add entry: `Fix navigation for the backup srp settings (#38544)` in `CHANGELOG.md`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 64b9b72. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Chaitanya Potti <[email protected]> [2e8d577](2e8d577) --------- Co-authored-by: Ganesh Suresh Patra <[email protected]> Co-authored-by: Chaitanya Potti <[email protected]> Co-authored-by: Gauthier Petetin <[email protected]>
1 parent 4edad43 commit 51a252f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5656
- Fixes layout inconsistencies while in fullscreen mode (#38483)
5757
- Fix shield confirmation transaction back handle in popup mode (#38502)
5858
- Fix asset page layout (#38537)
59+
- Fix navigation for the backup srp settings (#38544)
5960

6061
## [13.11.2]
6162

ui/pages/onboarding-flow/creation-successful/creation-successful.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ export default function CreationSuccessful() {
110110
data-testid="manage-default-settings"
111111
borderRadius={BorderRadius.LG}
112112
width={BlockSize.Full}
113-
onClick={() => navigate(ONBOARDING_PRIVACY_SETTINGS_ROUTE)}
113+
onClick={() =>
114+
navigate(`${ONBOARDING_PRIVACY_SETTINGS_ROUTE}?isFromReminder=true`)
115+
}
114116
>
115117
<Box display={Display.Flex} alignItems={AlignItems.center}>
116118
<Icon

ui/pages/onboarding-flow/privacy-settings/privacy-settings.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useContext, useState } from 'react';
22
import { useDispatch, useSelector } from 'react-redux';
3-
import { useNavigate } from 'react-router-dom-v5-compat';
3+
import { useLocation, useNavigate } from 'react-router-dom-v5-compat';
44
import classnames from 'classnames';
55
import { ButtonVariant } from '@metamask/snaps-sdk';
66
import log from 'loglevel';
@@ -136,6 +136,10 @@ export default function PrivacySettings() {
136136

137137
const isBackupAndSyncEnabled = useSelector(selectIsBackupAndSyncEnabled);
138138

139+
const { search } = useLocation();
140+
const searchParams = new URLSearchParams(search);
141+
const isFromReminder = searchParams.get('isFromReminder');
142+
139143
const handleSubmit = () => {
140144
dispatch(setUse4ByteResolution(turnOn4ByteResolution));
141145
dispatch(setUseTokenDetection(turnOnTokenDetection));
@@ -162,7 +166,13 @@ export default function PrivacySettings() {
162166
turnon_token_detection: turnOnTokenDetection,
163167
},
164168
});
165-
navigate(ONBOARDING_COMPLETION_ROUTE, { replace: true });
169+
if (isFromReminder) {
170+
navigate(`${ONBOARDING_COMPLETION_ROUTE}?isFromReminder=true`, {
171+
replace: true,
172+
});
173+
} else {
174+
navigate(ONBOARDING_COMPLETION_ROUTE, { replace: true });
175+
}
166176
};
167177

168178
const handleIPFSChange = (url) => {

0 commit comments

Comments
 (0)