Skip to content

Commit

Permalink
Skip setup is flag set
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman authored and TonyGiorgio committed Apr 11, 2024
1 parent 183449e commit 936f66f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/logic/mutinyWalletSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export async function setupMutinyWallet(
network,
esplora,
rgs,
lsp,
shouldUseLSPS ? undefined : lsp,
shouldUseLSPS ? lsps_connection_string : undefined,
shouldUseLSPS ? lsps_token : undefined,
auth,
Expand Down
14 changes: 13 additions & 1 deletion src/state/megaStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
getSettings,
initializeWasm,
MutinyWalletSettingStrings,
setSettings,
setupMutinyWallet
} from "~/logic/mutinyWalletSetup";
import { ParsedParams, toParsedParams } from "~/logic/waila";
Expand Down Expand Up @@ -194,6 +195,15 @@ export const Provider: ParentComponent = (props) => {
const settings = await getSettings();
setState({ load_stage: "setup" });

// handle lsp settings
if (searchParams.lsps) {
settings.lsp = "";
settings.lsps_connection_string = searchParams.lsps;
settings.lsps_token = searchParams.token;

await setSettings(settings);
}

const mutinyWallet = await setupMutinyWallet(
settings,
password,
Expand Down Expand Up @@ -509,6 +519,8 @@ export const Provider: ParentComponent = (props) => {
};
}

const [params, _] = useSearchParams();

onMount(async () => {
await checkForExistingTab();
if (state.existing_tab_detected) {
Expand All @@ -528,7 +540,7 @@ export const Provider: ParentComponent = (props) => {
setState({ load_stage: "checking_for_existing_wallet" });
const existing = await MutinyWallet.has_node_manager();

if (!existing) {
if (!existing && !params.skip_setup) {
navigate("/setup");
return;
}
Expand Down

0 comments on commit 936f66f

Please sign in to comment.