Skip to content

Commit

Permalink
add account name to notify
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed Aug 29, 2024
1 parent 989d81e commit b0ac1e5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ interface Props {

export default function ForgetAccountModal ({ account, setDisplayPopup }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const theme = useTheme();
const onAction = useContext(ActionContext);
const { notify } = useAlerts();

const [isBusy, setIsBusy] = useState(false);
const [password, setPassword] = useState<string>('');
const [checkConfirmed, setCheckConfirmed] = useState<boolean>(false);
const [isPasswordError, setIsPasswordError] = useState(false);
const theme = useTheme();
const needsPasswordConfirmation = !account.isExternal;

useEffect(() => {
Expand Down Expand Up @@ -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('/');
Expand All @@ -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);
Expand Down

0 comments on commit b0ac1e5

Please sign in to comment.