Skip to content

Commit 094f74a

Browse files
committed
Ensure modal doesn't show when loading hw wallets
1 parent b33cae8 commit 094f74a

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

src/views/WalletSelect.svelte

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,6 @@
9898
deviceWallets.length > 4 ? deviceWallets.slice(4) : undefined
9999
}
100100
101-
modalData = {
102-
heading,
103-
description,
104-
explanation,
105-
primaryWallets,
106-
secondaryWallets
107-
}
108-
109101
if (appState.autoSelectWallet) {
110102
const module = deviceWallets.find(
111103
(m: WalletModule) => m.name === appState.autoSelectWallet
@@ -114,15 +106,23 @@
114106
app.update(store => ({ ...store, autoSelectWallet: '' }))
115107
116108
if (module) {
117-
handleWalletSelect(module)
109+
handleWalletSelect(module, true)
118110
return
119111
}
120112
}
121113
114+
modalData = {
115+
heading,
116+
description,
117+
explanation,
118+
primaryWallets,
119+
secondaryWallets
120+
}
121+
122122
app.update(store => ({ ...store, walletSelectDisplayedUI: true }))
123123
}
124124
125-
async function handleWalletSelect(module: WalletModule) {
125+
async function handleWalletSelect(module: WalletModule, autoSelected?: boolean) {
126126
const currentWalletInterface = get(walletInterface)
127127
128128
if (currentWalletInterface && currentWalletInterface.name === module.name) {
@@ -163,7 +163,18 @@
163163
selectedWallet: selectedWalletModule.name
164164
})
165165
166-
app.update(store => ({ ...store, walletSelectDisplayedUI: true }))
166+
// if it was autoSelected then we need to add modalData to show the modal
167+
if (autoSelected) {
168+
modalData = {
169+
heading,
170+
description,
171+
explanation,
172+
primaryWallets,
173+
secondaryWallets
174+
}
175+
176+
app.update(store => ({ ...store, walletSelectDisplayedUI: true }))
177+
}
167178
168179
return
169180
}

0 commit comments

Comments
 (0)