File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 9
9
WalletStateSliceStore ,
10
10
StateSyncer ,
11
11
BalanceStore ,
12
- CancelablePromise
12
+ CancelablePromise ,
13
+ WalletCheckModule
13
14
} from './interfaces'
14
15
15
16
export const app : WritableStore = writable ( {
@@ -24,7 +25,8 @@ export const app: WritableStore = writable({
24
25
walletCheckInProgress : false ,
25
26
walletCheckCompleted : false ,
26
27
accountSelectInProgress : false ,
27
- autoSelectWallet : ''
28
+ autoSelectWallet : '' ,
29
+ checkModules : [ ]
28
30
} )
29
31
30
32
export const balanceSyncStatus : {
@@ -144,12 +146,17 @@ export function resetWalletState(options?: {
144
146
return currentInterface
145
147
} )
146
148
147
- app . update ( store => ( {
148
- ...store ,
149
- walletSelectInProgress : false ,
150
- walletSelectCompleted : false ,
151
- autoSelect : false
152
- } ) )
149
+ app . update ( store => {
150
+ Array . isArray ( store . checkModules ) &&
151
+ store . checkModules . forEach ( ( m : WalletCheckModule ) => m . reset && m . reset ( ) )
152
+
153
+ return {
154
+ ...store ,
155
+ walletSelectInProgress : false ,
156
+ walletSelectCompleted : false ,
157
+ autoSelect : false
158
+ }
159
+ } )
153
160
}
154
161
155
162
function createWalletInterfaceStore (
Original file line number Diff line number Diff line change 11
11
} from ' ../interfaces'
12
12
13
13
export let walletSelectModule: WalletSelectModule
14
- export let walletCheckModules: WalletCheckModule
15
14
export let walletSelect: WalletSelectFunction
16
15
</script >
17
16
41
40
{/if }
42
41
43
42
{#if $app .walletCheckInProgress }
44
- <WalletCheck modules ={ walletCheckModules } {walletSelect } />
43
+ <WalletCheck {walletSelect } />
45
44
{/if }
46
45
47
46
{#if $app .accountSelectInProgress }
Original file line number Diff line number Diff line change 28
28
UserState
29
29
} from ' ../interfaces'
30
30
31
- export let modules: WalletCheckModule [] | Promise <WalletCheckModule []> = []
32
31
export let walletSelect: WalletSelectFunction
33
32
34
33
const blocknative = getBlocknative ()
57
56
async function renderModule() {
58
57
checkingModule = true
59
58
59
+ let modules = get (app ).checkModules
60
+
60
61
if (isPromise (modules )) {
61
62
modules = await modules
62
63
modules .forEach (validateWalletCheckModule )
64
+ app .update (store => ({ ... store , checkModules: modules }))
63
65
}
64
66
65
67
const currentWallet = get (wallet ).name
You can’t perform that action at this time.
0 commit comments