From 44b6fec6ac125f11e9fa79ab5269dc72daef11ce Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Mon, 18 Mar 2024 20:54:26 -0400 Subject: [PATCH 1/2] ZEUS-2069: Settings: automatically upgrade users on old LSP host --- stores/SettingsStore.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/stores/SettingsStore.ts b/stores/SettingsStore.ts index 1eba24fb1..2b86a8964 100644 --- a/stores/SettingsStore.ts +++ b/stores/SettingsStore.ts @@ -1277,6 +1277,25 @@ export default class SettingsStore { await EncryptedStorage.setItem(MOD_KEY, 'true'); } + const MOD_KEY2 = 'lsp-preview-mod'; + const mod2 = await EncryptedStorage.getItem(MOD_KEY2); + if (!mod2) { + if ( + this.settings?.lspMainnet === + 'https://lsp-preview.lnolymp.us' + ) { + this.settings.lspMainnet = DEFAULT_LSP_MAINNET; + } + if ( + this.settings?.lspTestnet === + 'https://testnet-lsp.lnolymp.us' + ) { + this.settings.lspTestnet = DEFAULT_LSP_TESTNET; + } + this.setSettings(JSON.stringify(this.settings)); + await EncryptedStorage.setItem(MOD_KEY2, 'true'); + } + // migrate old POS squareEnabled setting to posEnabled if (this.settings?.pos?.squareEnabled) { this.settings.pos.posEnabled = PosEnabled.Square; From 0caae89cf226fed5cb2bd981fd140a71a31be879 Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Mon, 18 Mar 2024 20:54:32 -0400 Subject: [PATCH 2/2] Wallet: mark connecting false before querying LSP --- views/Wallet/Wallet.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/views/Wallet/Wallet.tsx b/views/Wallet/Wallet.tsx index bc3a5903d..e2f864445 100644 --- a/views/Wallet/Wallet.tsx +++ b/views/Wallet/Wallet.tsx @@ -453,6 +453,10 @@ export default class Wallet extends React.Component { } } + if (connecting) { + setConnectingStatus(false); + } + if (BackendUtils.supportsLSPs()) { if (SettingsStore.settings.enableLSP) { await LSPStore.getLSPInfo(); @@ -460,10 +464,6 @@ export default class Wallet extends React.Component { LSPStore.initChannelAcceptor(); } - if (connecting) { - setConnectingStatus(false); - } - // only navigate to initial url after connection and main calls are made if (this.state.initialLoad) { this.setState({