Closed Louis-kupo closed 1 year ago
Thanks, great find! This seems like the right solution to me.
Could you fix the lint error? yarn lint:fix
should fix the lint error being highlighted by CI.
Thanks, great find! This seems like the right solution to me.
Could you fix the lint error?
yarn lint:fix
should fix the lint error being highlighted by CI.
ok
Reason
Change the accountsChanged callback object to a new object , or will cause loop.This is because the callback function of accountsChanged returns the reference of the accounts, so request eth_accounts after externally modifying the reference of the account will cause accountsChanged to be triggered again, then it keeps looping
Reproducibility
If you change the result returned by accountsChanged and request eth_accounts again, you will enter a loop .
Solution
In the callback of accountsChanged, return the deep copy object