Skip to content

Commit

Permalink
fix: edit orders
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Sep 29, 2023
1 parent 3f84255 commit 4caf997
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,9 @@ const useRequestCancelOrder = ({
const { signature, salt } = await signOrder(orderEditing)
pushOrderNeedCreated({ ...orderEditing, salt, signature })
}
const resp = await (cancelType === CancelOrderType.HARD_CANCEL
? requestHardCancelOrder(orders?.[0])
: requestGasLessCancelOrder(orders))

setFlowState(state => ({ ...state, attemptingTxn: false, showConfirm: false }))
const gaslessCancel = cancelType === CancelOrderType.GAS_LESS_CANCEL
const resp = await (gaslessCancel ? requestGasLessCancelOrder(orders) : requestHardCancelOrder(orders?.[0]))
setFlowState(state => ({ ...state, attemptingTxn: false, showConfirm: !!(isEdit && gaslessCancel) }))
return resp
} catch (error) {
if (isEdit && orders[0]) removeOrderNeedCreated(orders[0].id)
Expand Down

0 comments on commit 4caf997

Please sign in to comment.