Use delete function for deleting while active

This commit is contained in:
Tony Giorgio
2023-07-26 15:33:35 -05:00
committed by Paul Miller
parent 69a6e1c03c
commit 169adfc73e

View File

@@ -194,15 +194,14 @@ export const Provider: ParentComponent = (props) => {
},
async deleteMutinyWallet(): Promise<void> {
try {
if (state.mutiny_wallet) {
await state.mutiny_wallet?.stop();
}
setState((prevState) => ({
...prevState,
mutiny_wallet: undefined,
deleting: true
}));
MutinyWallet.import_json("{}");
if (state.mutiny_wallet) {
await state.mutiny_wallet?.stop();
await state.mutiny_wallet?.delete_all();
}
} catch (e) {
console.error(e);
}