Skip to content

Commit

Permalink
fix: lo dont close
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Nov 22, 2023
1 parent 8c50561 commit 974033f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ export const useProcessCancelOrder = ({
if (signal.aborted) return
setCancelStatus(gasLessCancel ? CancelStatus.COUNTDOWN : CancelStatus.WAITING)
const expired = data?.orders?.[0]?.operatorSignatureExpiredAt
if (expired) setExpiredTime(expired)
else onDismiss()
if (expired) {
setExpiredTime(expired)
if (expired * 1000 < Date.now()) setCancelStatus(CancelStatus.CANCEL_DONE)
} else onDismiss()
} catch (error) {
if (signal.aborted) return
setExpiredTime(0)
Expand Down
2 changes: 1 addition & 1 deletion src/components/swapv2/LimitOrder/Modals/CancelButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const CancelButtons = ({
isEdit={isEdit}
gasAmountDisplay={gasAmountDisplay}
buttonGasless={
<ButtonPrimary {...propsGasless} onClick={onDismiss}>
<ButtonPrimary {...propsGasless} color={undefined} onClick={onDismiss}>
<Check size={18} />
&nbsp;
<Trans>Close</Trans>
Expand Down

0 comments on commit 974033f

Please sign in to comment.