From a7ad9c8c7e6aa9f7cf6d00975867a125ef5f7fd3 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Thu, 1 Dec 2022 02:18:42 -0800 Subject: [PATCH] Fix swap dispute prompts --- .../src/components/OrderDetails/LinearDeterminate.tsx | 8 ++++---- frontend/src/components/TradeBox/index.tsx | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/OrderDetails/LinearDeterminate.tsx b/frontend/src/components/OrderDetails/LinearDeterminate.tsx index a0a8a30e..62c0f511 100644 --- a/frontend/src/components/OrderDetails/LinearDeterminate.tsx +++ b/frontend/src/components/OrderDetails/LinearDeterminate.tsx @@ -8,17 +8,17 @@ interface Props { } const LinearDeterminate = ({ expiresAt, totalSecsExp }: Props): JSX.Element => { - const timePercentLeft = function(){ - if (expiresAt && totalSecsExp){ + const timePercentLeft = function () { + if (expiresAt && totalSecsExp) { const lapseTime = calcTimeDelta(new Date(expiresAt)).total / 1000; return (lapseTime / totalSecsExp) * 100; } else { return 100; } - } + }; const [progress, setProgress] = useState(timePercentLeft); - + useEffect(() => { const timer = setInterval(() => { setProgress(timePercentLeft); diff --git a/frontend/src/components/TradeBox/index.tsx b/frontend/src/components/TradeBox/index.tsx index 3aea9583..98610a28 100644 --- a/frontend/src/components/TradeBox/index.tsx +++ b/frontend/src/components/TradeBox/index.tsx @@ -603,15 +603,15 @@ const TradeBox = ({ // 18: 'Taker lost dispute' } else if ((status == 17 && isMaker) || (status == 18 && !isMaker)) { title = 'You have won the dispute'; - prompt = function () { - return ; - }; - } else if ((status == 17 && !isMaker) || (status == 18 && isMaker)) { - title = 'You have lost the dispute'; prompt = function () { return ; }; bondStatus = 'settled'; + } else if ((status == 17 && !isMaker) || (status == 18 && isMaker)) { + title = 'You have lost the dispute'; + prompt = function () { + return ; + }; } return { title, titleVariables, titleColor, prompt, bondStatus, titleIcon };