Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZEUS-2069: Settings: automatically upgrade users on old LSP host #2071

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions stores/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions views/Wallet/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,17 +453,17 @@ export default class Wallet extends React.Component<WalletProps, WalletState> {
}
}

if (connecting) {
setConnectingStatus(false);
}

if (BackendUtils.supportsLSPs()) {
if (SettingsStore.settings.enableLSP) {
await LSPStore.getLSPInfo();
}
LSPStore.initChannelAcceptor();
}

if (connecting) {
setConnectingStatus(false);
}

// only navigate to initial url after connection and main calls are made
if (this.state.initialLoad) {
this.setState({
Expand Down