Fix importing and reselecting the same account and cleanup#984
Fix importing and reselecting the same account and cleanup#984
Conversation
MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
Codecov Report
@@ Coverage Diff @@
## master #984 +/- ##
==========================================
+ Coverage 88.73% 88.78% +0.05%
==========================================
Files 100 100
Lines 1757 1748 -9
Branches 407 405 -2
==========================================
- Hits 1559 1552 -7
+ Misses 198 196 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
f1c6464 to
fc46d54
Compare
|
re-importing of a wallet does not work without |
|
I'm not sure what you mean. Yes, re-importing of a wallet does not work, either way. This is not an attempt to fix it tho. And an ugly way to fix it remains possible: if (selectImmediately) {
yield* put(walletActions.selectWallet(undefined))
yield* put(walletActions.selectWallet(walletId))
} |
|
Yes, please include this action if you want to remove |
79a3180 to
3c9c95e
Compare
|
Added back selecting Larger solutions:
|
7ac5576 to
864e274
Compare
|
not sure it's wip or ready for review, but reselecting is still failing for me for a mnemonic and ledger, but works for a priv key. |
|
oh, it's supposed to work :/ |
|
Alright, it's ready now. |
| if (newWallet.selectImmediately) { | ||
| if (selectImmediately) { | ||
| yield* put(walletActions.selectWallet(undefined)) // Workaround so useRouteRedirects detects selecting the same account | ||
| yield* delay(1) |
There was a problem hiding this comment.
ouch, can you add a comment that this is used to avoid React batch updates?
There was a problem hiding this comment.
yep yep
Tho I'm not sure why this would be batched in react 17 🤷
Reverts 52dde69, but moves the workaround to avoid bugs with importing multiple accounts.
2381e00 to
ce24369
Compare
Fixes #980 (comment)