Skip to content

Commit 05113ed

Browse files
authored
Merge pull request #157 from blocknative/fix/balance-subscription
Make sure balance subscription is only called when value changes. Closes #155
2 parents 3588349 + e74d09d commit 05113ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stores.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ function createBalanceStore(initialState: string | null): BalanceStore {
204204

205205
emitterAddress = $address
206206
}
207-
} else {
208-
// no address, so set balance back to null
207+
} else if (emitterAddress && !$address) {
208+
// no address, so set balance to undefined
209209
set && set(undefined)
210210
}
211211
}

0 commit comments

Comments
 (0)