1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Onboarding V2: Fix 'Securing my Wallet' when coming from backup reminder after account recovery (#17088)

This commit is contained in:
ryanml 2023-01-05 23:14:32 -07:00 committed by GitHub
parent b1254843ac
commit e8809cffaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useHistory } from 'react-router-dom'; import { useHistory, useLocation } from 'react-router-dom';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Box from '../../../components/ui/box'; import Box from '../../../components/ui/box';
import Button from '../../../components/ui/button'; import Button from '../../../components/ui/button';
@ -23,9 +23,14 @@ import RecoveryPhraseChips from './recovery-phrase-chips';
export default function RecoveryPhrase({ secretRecoveryPhrase }) { export default function RecoveryPhrase({ secretRecoveryPhrase }) {
const history = useHistory(); const history = useHistory();
const t = useI18nContext(); const t = useI18nContext();
const { search } = useLocation();
const [copied, handleCopy] = useCopyToClipboard(); const [copied, handleCopy] = useCopyToClipboard();
const [phraseRevealed, setPhraseRevealed] = useState(false); const [phraseRevealed, setPhraseRevealed] = useState(false);
const [hiddenPhrase, setHiddenPhrase] = useState(false); const [hiddenPhrase, setHiddenPhrase] = useState(false);
const searchParams = new URLSearchParams(search);
const isFromReminderParam = searchParams.get('isFromReminder')
? '/?isFromReminder=true'
: '';
return ( return (
<div className="recovery-phrase" data-testid="recovery-phrase"> <div className="recovery-phrase" data-testid="recovery-phrase">
@ -122,7 +127,9 @@ export default function RecoveryPhrase({ secretRecoveryPhrase }) {
type="primary" type="primary"
className="recovery-phrase__footer--button" className="recovery-phrase__footer--button"
onClick={() => { onClick={() => {
history.push(ONBOARDING_CONFIRM_SRP_ROUTE); history.push(
`${ONBOARDING_CONFIRM_SRP_ROUTE}${isFromReminderParam}`,
);
}} }}
> >
{t('next')} {t('next')}

View File

@ -1,5 +1,5 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useHistory } from 'react-router-dom'; import { useHistory, useLocation } from 'react-router-dom';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import Box from '../../../components/ui/box'; import Box from '../../../components/ui/box';
import Button from '../../../components/ui/button'; import Button from '../../../components/ui/button';
@ -23,12 +23,17 @@ import SkipSRPBackup from './skip-srp-backup-popover';
export default function SecureYourWallet() { export default function SecureYourWallet() {
const history = useHistory(); const history = useHistory();
const t = useI18nContext(); const t = useI18nContext();
const { search } = useLocation();
const currentLocale = useSelector(getCurrentLocale); const currentLocale = useSelector(getCurrentLocale);
const [showSkipSRPBackupPopover, setShowSkipSRPBackupPopover] = const [showSkipSRPBackupPopover, setShowSkipSRPBackupPopover] =
useState(false); useState(false);
const searchParams = new URLSearchParams(search);
const isFromReminderParam = searchParams.get('isFromReminder')
? '/?isFromReminder=true'
: '';
const handleClickRecommended = () => { const handleClickRecommended = () => {
history.push(ONBOARDING_REVIEW_SRP_ROUTE); history.push(`${ONBOARDING_REVIEW_SRP_ROUTE}${isFromReminderParam}`);
}; };
const handleClickNotRecommended = () => { const handleClickNotRecommended = () => {