Skip to content

Commit

Permalink
Merge branch 'main' into pr/1684
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed Dec 4, 2024
2 parents 2795aa6 + b13be69 commit 002c140
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export default function ForgetAccountModal ({ account, setDisplayPopup }: Props)
const [isPasswordError, setIsPasswordError] = useState(false);
const needsPasswordConfirmation = !account.isExternal;

const notOnHome = window.location.hash !== '#/';

useEffect(() => {
cryptoWaitReady().then(() => keyring.loadAll({ store: new AccountsStore() })).catch(() => null);
}, []);
Expand Down Expand Up @@ -80,7 +82,7 @@ export default function ForgetAccountModal ({ account, setDisplayPopup }: Props)
notify(t('{{accountName}} has been successfully removed!', { replace: { accountName: account?.name || 'Unknown' } }), 'success');

backToAccount();
onAction('/');
notOnHome && onAction('/');
})
.catch((error: Error) => {
setIsBusy(false);
Expand All @@ -91,7 +93,7 @@ export default function ForgetAccountModal ({ account, setDisplayPopup }: Props)
setIsBusy(false);
console.error('Error forgetting the account:', error);
}
}, [account, backToAccount, needsPasswordConfirmation, notify, onAction, password, t, updateAuthAccountsList]);
}, [account.address, account.name, backToAccount, notOnHome, needsPasswordConfirmation, notify, onAction, password, t, updateAuthAccountsList]);

const onChangePass = useCallback((pass: string): void => {
setPassword(pass);
Expand Down

0 comments on commit 002c140

Please sign in to comment.