-
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
[1] fix(twap): display fallback handler banner when it's relevant #2757
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const { showPriceImpactWarning } = useTwapWarningsContext() | ||
const isFallbackHandlerRequired = useIsFallbackHandlerRequired() | ||
|
||
if (showPriceImpactWarning) return isPriceImpactAccepted |
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.
not sure this is what you wanted to do
Didn;t you mean sth like if (showPriceImpactWarning && !isPriceImpactAccepted) return 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.
In this hook, I like to take into account isPriceImpactAccepted
value only when showPriceImpactWarning
is true.
So, I can translate it as:
When price impact is shown, then take the "Price impact accepted" checkbox value into account
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.
But can it be showPriceImpactWarning
and isFallbackHandlerRequired
in my proposal above it says, "if we show the price impact and is not accepted, return false, otherwise continue with the following logic" this way we consider other checks. If all check pass then we return true
Maybe I'm reading it wrong?
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! However, I have found #2771 issue while testing the PR
… fix/twap-handler-banner
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.
Some minor questions/concerns
Summary
To Test