Update ContractStore.walletConnected in AccountListener when the user disconnects the wallet #1119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #823
Disconnecting your wallet in MetaMask resets your balance, but not your pending yield or lifetime earningsand
I had the opposite experience today: my balance remained but the other two numbers were removed.occurred because we were waiting until the fetch queries were completed in
AccountListenerafter a wallet is disconnected.A good way to reproduce some of this behavior is to connect the wallet first. Then, open Chrome DevTools -> Network -> set it to "offline" to force fetch queries to fail. And then, disconnect the wallet and see that "Pending Yield" still has the value set on the header.
A better approach is to update
ContractStoreand setContractStore.walletConnected = falsewhenuseWeb3Reacttells us that the account is no longeractiveas soon as the user disconnects their wallet.