From 8320a95e16156ee3d7fe460e91ba50bfa9671b2c Mon Sep 17 00:00:00 2001 From: Gustavo Fuhr Date: Wed, 30 Nov 2022 04:31:34 -0300 Subject: [PATCH] fixes tests --- packages/webapp/src/app.tsx | 2 +- .../webapp/src/components/registration-callback/index.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index 882e8dff..d1b1f9ce 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -71,7 +71,7 @@ const App = (): ReactElement => { } /> } /> } /> - + } /> } /> } /> { const [email, setEmail] = useState(undefined); const [syncCode, setSyncCode] = useState(undefined); const [googleSync, setGoogleSync] = useState(undefined); - const history = useHistory(); + const navigate = useNavigate(); useEffect(() => { document.title = intl.formatMessage({ @@ -42,7 +42,7 @@ const RegistrationCallbackPage = (): React.ReactElement => { .then((result) => { if (result.googleSync) { // if service reports that user already has sync accounts, go to maps page - history.push('/c/maps'); + navigate('/c/maps'); } setEmail(result.email); setSyncCode(result.syncCode); @@ -62,7 +62,7 @@ const RegistrationCallbackPage = (): React.ReactElement => { client .confirmAccountSync(email, syncCode) .then(() => { - history.push('/c/maps'); + navigate('/c/maps'); }) .catch((error) => { console.log('ERROR', error);