From 70e43691c25ee8261cf1df5b94de1df2315bf35b Mon Sep 17 00:00:00 2001 From: Danh Date: Thu, 14 Sep 2023 14:48:52 +0700 Subject: [PATCH] cancel success status --- .../LimitOrder/Modals/CancelStatusCountDown.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/components/swapv2/LimitOrder/Modals/CancelStatusCountDown.tsx b/src/components/swapv2/LimitOrder/Modals/CancelStatusCountDown.tsx index c1783ed2b5..e4cf8d84fa 100644 --- a/src/components/swapv2/LimitOrder/Modals/CancelStatusCountDown.tsx +++ b/src/components/swapv2/LimitOrder/Modals/CancelStatusCountDown.tsx @@ -6,14 +6,12 @@ import { Flex, Text } from 'rebass' import styled from 'styled-components' import { ReactComponent as TimerIcon } from 'assets/svg/clock_timer.svg' -import { NotificationType } from 'components/Announcement/type' import { Clock } from 'components/Icons' import WarningIcon from 'components/Icons/WarningIcon' import Loader from 'components/Loader' import { CancelStatus } from 'components/swapv2/LimitOrder/Modals/CancelOrderModal' import useInterval from 'hooks/useInterval' import useTheme from 'hooks/useTheme' -import { useNotify } from 'state/application/hooks' import { ExternalLink } from 'theme' import { TransactionFlowState } from 'types/TransactionFlowState' import { friendlyError } from 'utils/errorMessage' @@ -63,7 +61,6 @@ export default function CancelStatusCountDown({ const pendingText = flowState.pendingText || t`Canceling order` const theme = useTheme() - const notify = useNotify() const [remain, setRemain] = useState(0) @@ -75,16 +72,11 @@ export default function CancelStatusCountDown({ const countdown = useCallback(() => { setRemain(v => { if (v - 1 === 0) { - setCancelStatus(CancelStatus.TIMEOUT) - notify({ - summary: t`Your cancellation request has timed out.`, - title: t`Limit Order`, - type: NotificationType.ERROR, - }) + setCancelStatus(CancelStatus.CANCEL_DONE) } return Math.max(0, v - 1) }) - }, [setCancelStatus, notify]) + }, [setCancelStatus]) useInterval(countdown, remain > 0 && cancelStatus === CancelStatus.COUNTDOWN ? 1000 : null)