-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX/LIVE-15117: exchange.swap does not have up-to-date accounts list when attempting to swap with newly created account. #8564
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ 4 Skipped Deployments
|
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.
LGTM π₯
@@ -55,6 +55,10 @@ import { registerTransportModules } from "~/renderer/live-common-setup"; | |||
const rootNode = document.getElementById("react-root"); | |||
const TAB_KEY = 9; | |||
|
|||
export const store = createStore({ |
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.
Are you sure it does not create a side effect to change where we create the store, please?
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.
As far as I can tell this does not create any side effects and just moves the creation of the store outside of the init function to allow access to the store directly.
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.
There is a side effect that you cannot reset the store by just calling init again
Not sure how much it impacts LLD but I suppose that it would have some risk with hot reloading in dev
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.
Is this change necessary ?
It doesn't seem correct to init the rest and not this in the function
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.
I feel like this solution is bypassing the issue instead of solving it
function getAccounts() { | ||
return flattenAccountsSelector(store.getState()); | ||
} |
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.
It's quite strange to do that directly instead of using a the selector with useSelector
It's seems we're not addressing the root cause of the issue, a change to the accounts should be reflected to the handlers
β Checklist
npx changeset
was attached.π Description
This was because the
exchangeHandlers
accounts param did not get updated when accounts were changed. Instead this PR proposes passing a getter function that will instead grab the users currents accounts when the function is run.β Context
https://ledgerhq.atlassian.net/browse/LIVE-15117
π§ Checklist for the PR Reviewers