try-catch potentially fallible mutiny_wallet calls

This commit is contained in:
Paul Miller
2023-06-20 13:54:52 -05:00
parent 5a7e67ea05
commit 6c4939603c
10 changed files with 139 additions and 87 deletions

View File

@@ -7,12 +7,16 @@ export function Restart() {
const [hasStopped, setHasStopped] = createSignal(false);
async function toggle() {
if (hasStopped()) {
await state.mutiny_wallet?.start();
setHasStopped(false);
} else {
await state.mutiny_wallet?.stop();
setHasStopped(true);
try {
if (hasStopped()) {
await state.mutiny_wallet?.start();
setHasStopped(false);
} else {
await state.mutiny_wallet?.stop();
setHasStopped(true);
}
} catch (e) {
console.error(e);
}
}