From b0ac1e5fb0f7f672f9f8f0dafdb425226cb74c4c Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 30 Aug 2024 01:09:09 +0330 Subject: [PATCH] add account name to notify --- .../src/popup/forgetAccount/ForgetAccountModal.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/extension-polkagate/src/popup/forgetAccount/ForgetAccountModal.tsx b/packages/extension-polkagate/src/popup/forgetAccount/ForgetAccountModal.tsx index ca7450890..417dfb12d 100644 --- a/packages/extension-polkagate/src/popup/forgetAccount/ForgetAccountModal.tsx +++ b/packages/extension-polkagate/src/popup/forgetAccount/ForgetAccountModal.tsx @@ -25,6 +25,7 @@ interface Props { export default function ForgetAccountModal ({ account, setDisplayPopup }: Props): React.ReactElement { const { t } = useTranslation(); + const theme = useTheme(); const onAction = useContext(ActionContext); const { notify } = useAlerts(); @@ -32,7 +33,6 @@ export default function ForgetAccountModal ({ account, setDisplayPopup }: Props) const [password, setPassword] = useState(''); const [checkConfirmed, setCheckConfirmed] = useState(false); const [isPasswordError, setIsPasswordError] = useState(false); - const theme = useTheme(); const needsPasswordConfirmation = !account.isExternal; useEffect(() => { @@ -77,7 +77,7 @@ export default function ForgetAccountModal ({ account, setDisplayPopup }: Props) .then(async () => { await updateAuthAccountsList(account.address); setIsBusy(false); - notify(t('The account has been successfully removed!'), 'success'); + notify(t('{{accountName}} has been successfully removed!', { replace: { accountName: account?.name || 'Unknown' } }), 'success'); backToAccount(); onAction('/'); @@ -89,9 +89,9 @@ export default function ForgetAccountModal ({ account, setDisplayPopup }: Props) } catch (error) { setIsPasswordError(true); setIsBusy(false); - console.error('Error forgetting an account:', error); + console.error('Error forgetting the account:', error); } - }, [account.address, backToAccount, needsPasswordConfirmation, notify, onAction, password, t, updateAuthAccountsList]); + }, [account, backToAccount, needsPasswordConfirmation, notify, onAction, password, t, updateAuthAccountsList]); const onChangePass = useCallback((pass: string): void => { setPassword(pass);