diff --git a/src/components/SetupErrorDisplay.tsx b/src/components/SetupErrorDisplay.tsx
index 4471ab3..f245a4b 100644
--- a/src/components/SetupErrorDisplay.tsx
+++ b/src/components/SetupErrorDisplay.tsx
@@ -60,6 +60,18 @@ export default function SetupErrorDisplay(props: { initialError: Error }) {
{" "}
for updates.
+
+ {i18n.t(
+ "error.on_boot.loading_failed.in_the_meantime"
+ )}{" "}
+
+ {" "}
+ {i18n.t(
+ "error.on_boot.loading_failed.safe_mode"
+ )}
+
+ .
+
diff --git a/src/i18n/en/translations.ts b/src/i18n/en/translations.ts
index db73cd7..5ec085b 100644
--- a/src/i18n/en/translations.ts
+++ b/src/i18n/en/translations.ts
@@ -19,7 +19,9 @@ export default {
why: "Why?",
private_tags: "Private tags",
view_transaction: "View Transaction",
- pending: "Pending"
+ pending: "Pending",
+ error_safe_mode:
+ "Mutiny is running in safe mode. Lightning is disabled."
},
contacts: {
new: "new",
@@ -479,7 +481,10 @@ export default {
"If you have any questions on what these buttons do, please",
support_link: "reach out to us for support.",
services_down:
- "It looks like one of Mutiny's services is down. Please try again later."
+ "It looks like one of Mutiny's services is down. Please try again later.",
+ in_the_meantime:
+ "In the meantime if you want to access your on-chain funds you can load Mutiny in",
+ safe_mode: "Safe Mode"
}
}
},
diff --git a/src/logic/mutinyWalletSetup.ts b/src/logic/mutinyWalletSetup.ts
index 18b4e1d..d2b28cd 100644
--- a/src/logic/mutinyWalletSetup.ts
+++ b/src/logic/mutinyWalletSetup.ts
@@ -163,7 +163,8 @@ export async function initializeWasm() {
export async function setupMutinyWallet(
settings: MutinyWalletSettingStrings,
- password?: string
+ password?: string,
+ safeMode?: boolean
): Promise
{
console.log("Starting setup...");
@@ -189,6 +190,7 @@ export async function setupMutinyWallet(
console.log("Using subscriptions address", subscriptions);
console.log("Using storage address", storage);
console.log("Using scorer address", scorer);
+ console.log(safeMode ? "Safe mode enabled" : "Safe mode disabled");
const mutinyWallet = await new MutinyWallet(
// Password
@@ -207,7 +209,9 @@ export async function setupMutinyWallet(
// Do not connect peers
undefined,
// Do not skip device lock
- undefined
+ undefined,
+ // Safe mode
+ safeMode || undefined
);
sessionStorage.setItem("MUTINY_WALLET_INITIALIZED", Date.now().toString());
diff --git a/src/state/megaStore.tsx b/src/state/megaStore.tsx
index 8fb082f..57a3634 100644
--- a/src/state/megaStore.tsx
+++ b/src/state/megaStore.tsx
@@ -24,6 +24,7 @@ import eify from "~/utils/eify";
import { timeout } from "~/utils/timeout";
import { ParsedParams } from "~/logic/waila";
import { subscriptionValid } from "~/utils/subscriptions";
+import { useSearchParams } from "solid-start";
const MegaStoreContext = createContext();
@@ -53,6 +54,7 @@ export type MegaStore = [
needs_password: boolean;
load_stage: LoadStage;
settings?: MutinyWalletSettingStrings;
+ safe_mode?: boolean;
},
{
setup(password?: string): Promise;
@@ -67,6 +69,8 @@ export type MegaStore = [
];
export const Provider: ParentComponent = (props) => {
+ const [searchParams] = useSearchParams();
+
const [state, setState] = createStore({
mutiny_wallet: undefined as MutinyWallet | undefined,
deleting: false,
@@ -87,7 +91,8 @@ export const Provider: ParentComponent = (props) => {
},
needs_password: false,
load_stage: "fresh" as LoadStage,
- settings: undefined as MutinyWalletSettingStrings | undefined
+ settings: undefined as MutinyWalletSettingStrings | undefined,
+ safe_mode: searchParams.safe_mode === "true"
});
const actions = {
@@ -132,7 +137,8 @@ export const Provider: ParentComponent = (props) => {
const mutinyWallet = await setupMutinyWallet(
settings,
- password
+ password,
+ state.safe_mode
);
// Give other components access to settings via the store