-
Notifications
You must be signed in to change notification settings - Fork 54
Fix change or disconnect wallet after claim confirm #2337
Conversation
|
||
// handle account disconnect or account change after claim is confirmed | ||
useEffect(() => { | ||
if (!account || (account !== previousAccount && claimStatus === ClaimStatus.CONFIRMED)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the useEffect trigger on account change? why is previousAccount needed? I would think
useEffect(() => {
if (!account || claimStatus === ClaimStatus.CONFIRMED) {
...
should work, it doesn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since claimStatus
is dependency this (!account || claimStatus === ClaimStatus.CONFIRMED)
would activate instantly when the status becomes confirmed and you would not see claim success view at all. So instead this account !== previousAccount && claimStatus === ClaimStatus.CONFIRMED
this will only activate when the account changes and the claim is confirmed.
…med-on-disconnect
|
I thought this was fixed in #2322, no? |
@alfetopito Just checked on release branch, looks like its still there when you disconnect the wallet after claim is confirmed you see this In that PR it doesn't reset the activeClaimedAccount because of cowswap/src/custom/pages/Claim/index.tsx Line 171 in de537f6
|
Hey @nenadV91 , changes LGTM! The same is for the flow when open another page and then go back to the Claim page. |
…med-on-disconnect
…med-on-disconnect
@elena-zh Should be all there now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Summary
Fixes #2251