-
Notifications
You must be signed in to change notification settings - Fork 2
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: ensure token lists and balances are loaded for new safe or network #128
fix: ensure token lists and balances are loaded for new safe or network #128
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ab9f1e5
to
9f30463
Compare
const amount = ref(props.transaction.amount ?? ''); | ||
const recipient = ref(props.transaction.recipient ?? ''); | ||
const tokens = ref<Token[]>([nativeAsset, ...props.tokens]); | ||
const tokens = ref<Token[]>(props.tokens); |
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 think we need to keep the native asset as first token in the list. is that possible?
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.
yeah that's possible 👍
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, i will pr this
fixes UMA-2395 UMA-2388
motivation
There was a bug in the transaction builder where the app would load all tokens you have balances for (your safe on a certain network), then when you switch safes, that list of tokens would not update. We also were not including the balance of the native token in the token chooser modal. This was because the balance pulled from gnosis, if that balance was for a native token it would be stripped out by the app, then later we just hardcoded in the native asset for the chain as an option, but without the balance info.
This PR rectifies some of the state management so that we relaod token balances and token lists when we switch safes.
It also ensures we keep the safe's balance for native tokens so we can display this data to the user.