-
Notifications
You must be signed in to change notification settings - Fork 102
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(orders-table): display allowance warning in Safe #5207
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hey @shoom3301 , everything looks good besides one bug (#3480) that has become reproducible here again |
@elena-zh thank you! Fixed that. |
) | ||
|
||
const withAllowanceWarning = hasEnoughAllowance === false && hasValidPendingPermit === false | ||
const withAllowanceWarning = hasEnoughAllowance === false |
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.
Now it's simplier, hasEnoughAllowance
already includes result of permit checks
@@ -43,7 +45,7 @@ export function getOrderParams( | |||
partiallyFillable: order.partiallyFillable, | |||
sellAmount, | |||
balance, | |||
allowance, | |||
allowance: getBiggerAmount(allowance, permitAmount), |
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 take allowance value from blockchain OR permit value from order appData, depending on what is bigger
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.
Works good now
}, {} as { [key: string]: true }) | ||
return acc | ||
}, | ||
{} as { [key: string]: true }, |
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.
nit, you can also specify the type without the casting selectedOrders.reduce<[key: string]: true>
Summary
Fixes #4076
hasValidPendingPermit
can beundefined
To Test
This issue was introduced in #3487, so please make sure this issue is not back.
See #4076