Browse Source
Half the number of `calculate` requests
We already have a `useEffect` that re-calculates the margin, no need
to do it again the onChange handler.
debug-collab-settlement
Thomas Eizinger
3 years ago
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96
1 changed files with
0 additions and
10 deletions
-
taker-frontend/src/App.tsx
|
@ -128,16 +128,6 @@ export const App = () => { |
|
|
onQuantityChange={(valueString: string) => { |
|
|
onQuantityChange={(valueString: string) => { |
|
|
setUserHasEdited(true); |
|
|
setUserHasEdited(true); |
|
|
setQuantity(parse(valueString)); |
|
|
setQuantity(parse(valueString)); |
|
|
if (!order) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
let quantity = valueString ? Number.parseFloat(valueString) : 0; |
|
|
|
|
|
let payload: MarginRequestPayload = { |
|
|
|
|
|
leverage: order.leverage, |
|
|
|
|
|
price: order.price, |
|
|
|
|
|
quantity, |
|
|
|
|
|
}; |
|
|
|
|
|
calculateMargin(payload); |
|
|
|
|
|
}} |
|
|
}} |
|
|
onLongSubmit={makeNewOrderRequest} |
|
|
onLongSubmit={makeNewOrderRequest} |
|
|
isLongSubmitting={isCreatingNewOrderRequest} |
|
|
isLongSubmitting={isCreatingNewOrderRequest} |
|
|