-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat(uirefresh): component refresh - trade box [2/2] #1214
base: main
Are you sure you want to change the base?
Changes from 4 commits
03142ed
bfcd548
5f9c631
0ea298c
efd7734
e4625ee
06a1846
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,7 +190,8 @@ class AbacusStateManager { | |
|
||
clearTradeInputSizeValues = () => { | ||
const state = this.store?.getState(); | ||
const { needsLeverage } = (state && getInputTradeOptions(state)) ?? {}; | ||
const { needsLeverage, needsTargetLeverage } = (state && getInputTradeOptions(state)) ?? {}; | ||
const { uiRefresh } = testFlags; | ||
this.setTradeValue({ value: null, field: TradeInputField.size }); | ||
this.setTradeValue({ value: null, field: TradeInputField.usdcSize }); | ||
this.setTradeValue({ value: null, field: TradeInputField.balancePercent }); | ||
|
@@ -199,6 +200,10 @@ class AbacusStateManager { | |
this.setTradeValue({ value: null, field: TradeInputField.leverage }); | ||
} | ||
|
||
if (uiRefresh && needsTargetLeverage) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just clear them all the time? I worry about edge cases where target leverage is entered but then needsTargetLeverage becomes false before this clear function is called and we just leave it there forever. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm yeah I was just following the existing patterns which always seem to check but I don't seem to see any issue with removing it 🤔 |
||
this.setTradeValue({ value: null, field: TradeInputField.targetLeverage }); | ||
} | ||
|
||
this.store?.dispatch(setTradeFormInputs(CLEARED_SIZE_INPUTS)); | ||
}; | ||
|
||
|
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.
shouldn't this be || ?