Skip to content

Commit 87bd999

Browse files
committed
Allow modules to be passed in
1 parent a334844 commit 87bd999

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/views/WalletCheck.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
} from '../interfaces'
3030
3131
export let walletSelect: WalletSelectFunction
32+
export let modules: WalletCheckModule[] | undefined
3233
3334
const blocknative = getBlocknative()
3435
@@ -73,18 +74,18 @@
7374
async function renderModule() {
7475
checkingModule = true
7576
76-
let modules = get(app).checkModules
77+
let checkModules = modules || get(app).checkModules
7778
78-
if (isPromise(modules)) {
79-
modules = await modules
80-
modules.forEach(validateWalletCheckModule)
81-
app.update(store => ({ ...store, checkModules: modules }))
79+
if (isPromise(checkModules)) {
80+
checkModules = await checkModules
81+
checkModules.forEach(validateWalletCheckModule)
82+
app.update(store => ({ ...store, checkModules }))
8283
}
8384
8485
const currentWallet = get(wallet).name
8586
8687
// loop through and run each module to check if a modal needs to be shown
87-
runModules(modules).then(
88+
runModules(checkModules).then(
8889
(result: {
8990
modal: WalletCheckModal | undefined
9091
module: WalletCheckModule | undefined
@@ -198,7 +199,6 @@
198199
}
199200
200201
loadingModal = false
201-
modules.forEach(m => m.reset && m.reset())
202202
return resolve({ modal: undefined, module: undefined })
203203
}
204204
)

0 commit comments

Comments
 (0)