Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix #28097 - Prevent redirect after adding network in Onboarding Settings #28165

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

darkwing
Copy link
Contributor

@darkwing darkwing commented Oct 29, 2024

Description

Prevents the post-add-network redirect from happening if the user is on the onboarding screen.

Related issues

Fixes: #28097

Manual testing steps

STR's are in #28097

Screenshots/Recordings

Before

After

Screen.Recording.2024-10-29.at.12.49.56.PM.mov

Pre-merge author checklist

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.

@darkwing darkwing requested a review from a team as a code owner October 29, 2024 17:50
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@darkwing darkwing changed the title Fix #28097 - Prevent redirect after adding network in Onboarding Settings fix: Fix #28097 - Prevent redirect after adding network in Onboarding Settings Oct 29, 2024
@@ -381,7 +384,13 @@ function getValues(pendingApproval, t, actions, history, data) {
nickname: pendingApproval.requestData.chainName,
});

history.push(DEFAULT_ROUTE);
const locationPath = document.location.hash.replace('#', '/');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix. I noticed this too but wasn't sure how to fix it. I was trying use state.metamask.completedOnboarding to determine whether to redirect, but didn't know how to access it here. document.location seems like it'll work

@metamaskbot
Copy link
Collaborator

Builds ready [fff1dfd]
Page Load Metrics (2082 ± 109 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint33426011908549263
domContentLoaded179125182055225108
load180126072082227109
domInteractive27140542713
backgroundConnect788302311
firstReactRender512891116431
getState571232311
initialActions01000
loadScripts131720071534214103
setupStore1286402613
uiStartup208128012344218105
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 79 Bytes (0.00%)

@darkwing darkwing added this pull request to the merge queue Oct 30, 2024
Merged via the queue into develop with commit 9cc7b41 Oct 30, 2024
89 of 91 checks passed
@darkwing darkwing deleted the fix-onboarding-network-redirect branch October 30, 2024 13:34
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2024
@metamaskbot metamaskbot added the release-12.7.0 Issue or pull request that will be included in release 12.7.0 label Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.7.0 Issue or pull request that will be included in release 12.7.0 team-wallet-ux
Projects
None yet
4 participants