Skip to content

Commit 39da588

Browse files
authored
Merge pull request #381 from blocknative/fix/wallet-subscription
Fix: Wallet Subscription. Closes #379
2 parents 3eebb66 + a3f4d34 commit 39da588

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/onboard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ function init(initialization: Initialization): API {
130130

131131
if (subscriptions.wallet) {
132132
wallet.subscribe((wallet: Wallet) => {
133-
wallet.provider !== null &&
134-
subscriptions.wallet &&
135-
subscriptions.wallet(wallet)
133+
if (wallet.provider !== null) {
134+
subscriptions.wallet && subscriptions.wallet(wallet)
135+
}
136136
})
137137
}
138138
}

src/stores.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ export function resetWalletState(options?: {
165165
// if walletName is the same as the current interface name then do a full reset (checking if to do a disconnect)
166166
if (currentInterface.name === walletName) {
167167
wallet.update(() => ({
168-
name: null,
169-
provider: null,
170-
connect: null,
171-
instance: null,
172-
dashboard: null
168+
name: undefined,
169+
provider: undefined,
170+
connect: undefined,
171+
instance: undefined,
172+
dashboard: undefined
173173
}))
174174

175175
!disconnected &&

0 commit comments

Comments
 (0)