From de84a9de3b92384d5a599bf1c2d3e726ebf0aab7 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 10 Nov 2023 01:06:40 -0600 Subject: [PATCH] Another double init check --- src/components/SetupErrorDisplay.tsx | 3 +++ src/state/megaStore.tsx | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/components/SetupErrorDisplay.tsx b/src/components/SetupErrorDisplay.tsx index a29cc6d..64c253c 100644 --- a/src/components/SetupErrorDisplay.tsx +++ b/src/components/SetupErrorDisplay.tsx @@ -186,6 +186,9 @@ export function SetupErrorDisplay(props: { initialError: Error }) { {i18n.t("error.on_boot.loading_failed.description")} + {i18n.t( "error.on_boot.loading_failed.repair_options" diff --git a/src/state/megaStore.tsx b/src/state/megaStore.tsx index 1ede4d8..fcc639f 100644 --- a/src/state/megaStore.tsx +++ b/src/state/megaStore.tsx @@ -149,6 +149,16 @@ export const Provider: ParentComponent = (props) => { throw state.setup_error; } + // If there's already a mutiny wallet in state abort! + if (state.mutiny_wallet) { + setState({ + setup_error: new Error( + "Existing Mutiny Wallet already running, aborting setup" + ) + }); + return; + } + setState({ wallet_loading: true, load_stage: "checking_double_init"