Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private accountsForget ({ address }: RequestAccountForget): boolean {
keyring.forgetAccount(address);
return true;
}
const _onForget = (): void => {
if (!address) {
return;
}
const status: Partial = {
account: address,
action: 'forget'
};
try {
keyring.forgetAccount(address);
status.status = 'success';
status.message = t('account forgotten');
} catch (error) {
status.status = 'error';
status.message = error.message;
}
};
const _onGenesisChange = (genesisHash: string | null): void => {
() => {
const status = {
account: current.address(),
action: 'forget'
} as ActionStatus;
try {
keyring.forgetAccount(
current.address()
);
status.status = 'success';
status.message = t('account forgotten');
} catch (error) {
status.status = 'error';
status.message = error.message;
}
onStatusChange(status);
}
);