Skip to content

Commit

Permalink
Merge branch 'main' into fix-email
Browse files Browse the repository at this point in the history
  • Loading branch information
apotdevin committed Aug 4, 2024
2 parents 2c79ca4 + 55a5b9e commit 98ebb44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/components/button/LogoutButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const LogoutButtonWithTooltip = () => {

const [logout] = useLogoutMutation({
onCompleted: () => {
window.location.href = ROUTES.home;
localStorage.removeItem(LOCALSTORAGE_KEYS.currentWalletId);
window.location.assign(ROUTES.home);
},
onError: () =>
toast({
Expand Down Expand Up @@ -50,7 +51,7 @@ export const LogoutButton = () => {
const [logout] = useLogoutMutation({
onCompleted: () => {
localStorage.removeItem(LOCALSTORAGE_KEYS.currentWalletId);
window.location.href = ROUTES.home;
window.location.assign(ROUTES.home);
},
onError: () =>
toast({
Expand Down
6 changes: 3 additions & 3 deletions src/views/settings/ChangePassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { useToast } from '@/components/ui/use-toast';
import { useChangePasswordMutation } from '@/graphql/mutations/__generated__/changePassword.generated';
import { useLogoutMutation } from '@/graphql/mutations/__generated__/logout.generated';
import { useUserQuery } from '@/graphql/queries/__generated__/user.generated';
import { LOCALSTORAGE_KEYS } from '@/utils/constants';
import { handleApolloError } from '@/utils/error';
import { ROUTES } from '@/utils/routes';
import { WorkerMessage, WorkerResponse } from '@/workers/account/types';
Expand Down Expand Up @@ -128,7 +129,8 @@ export const ChangePassword = () => {

const [logout] = useLogoutMutation({
onCompleted: () => {
window.location.href = ROUTES.login;
localStorage.removeItem(LOCALSTORAGE_KEYS.currentWalletId);
window.location.assign(ROUTES.home);
},
onError: error => {
const messages = handleApolloError(error);
Expand All @@ -138,8 +140,6 @@ export const ChangePassword = () => {
title: 'Error logging out.',
description: messages.join(', '),
});

window.location.reload();
},
});

Expand Down

0 comments on commit 98ebb44

Please sign in to comment.