Skip to content

Commit 1b3ac3e

Browse files
authored
use history.push for hash routing (#31)
1 parent 88effd5 commit 1b3ac3e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/popup/views/CreatePassword/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect } from "react";
22
import { useDispatch, useSelector } from "react-redux";
33
import { Formik } from "formik";
44
import { object as YupObject } from "yup";
5+
import { history } from "popup/App";
56
import { createAccount, publicKeySelector } from "popup/ducks/authServices";
67
import { Onboarding } from "popup/components/Layout/Fullscreen/Onboarding";
78
import Form from "popup/components/Form";
@@ -19,7 +20,6 @@ import {
1920
termsOfUse as termsofUseValidator,
2021
} from "popup/components/Form/validators";
2122
import { EMOJI } from "popup/constants";
22-
import { history } from "popup/App";
2323

2424
const CreatePassword = () => {
2525
const publicKey = useSelector(publicKeySelector);
@@ -58,7 +58,7 @@ const CreatePassword = () => {
5858
header="Create a password"
5959
subheader="Min 10 characters"
6060
icon={EMOJI.see_no_evil}
61-
goBack={() => window.location.replace("/")}
61+
goBack={() => history.push({ pathname: "/" })}
6262
>
6363
<Formik
6464
initialValues={initialValues}

src/popup/views/RecoverAccount/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect } from "react";
22
import { useDispatch, useSelector } from "react-redux";
33
import { Formik } from "formik";
44
import { object as YupObject, string as YupString } from "yup";
5+
import { history } from "popup/App";
56
import {
67
password as passwordValidator,
78
confirmPassword as confirmPasswordValidator,
@@ -81,7 +82,7 @@ const RecoverAccount = () => {
8182
<Onboarding
8283
header="Recover wallet from backup phrase"
8384
icon={icon}
84-
goBack={() => window.location.replace("/")}
85+
goBack={() => history.push({ pathname: "/" })}
8586
>
8687
<>
8788
<FormRow>

0 commit comments

Comments
 (0)