mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-18 06:44:27 +01:00
try-catch potentially fallible mutiny_wallet calls
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user