From 923a76896bd5226c5ae63b996a912fc30f4b6c9f Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 14 Jun 2022 19:18:24 +0200 Subject: [PATCH] fix(web/progress): remove cancelled timeout animation This is not a fix, it's a workaround, removes the red animation when cancelling due to it causing the progress bar/circle to be permanently stuck --- web/src/features/progress/CircleProgressbar.tsx | 17 ++++------------- web/src/features/progress/Progressbar.tsx | 5 ++--- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/web/src/features/progress/CircleProgressbar.tsx b/web/src/features/progress/CircleProgressbar.tsx index cf1fd9a..e7fc72e 100644 --- a/web/src/features/progress/CircleProgressbar.tsx +++ b/web/src/features/progress/CircleProgressbar.tsx @@ -42,9 +42,7 @@ const CircleProgressbar: React.FC = () => { const progressCancel = () => { setCancelled(true); setValue(99); // Sets the final value to 100% kek - setTimeout(() => { - setVisible(false); - }, 2500); + setVisible(false); }; useNuiEvent("progressCancel", progressCancel); @@ -77,10 +75,7 @@ const CircleProgressbar: React.FC = () => { alignItems="center" > {visible && ( - + { }, } : { + // Currently unused ".chakra-progress__indicator": { transition: "none !important", strokeDasharray: "264, 0 !important", // sets circle to full @@ -110,12 +106,7 @@ const CircleProgressbar: React.FC = () => { {value}% - + {label} diff --git a/web/src/features/progress/Progressbar.tsx b/web/src/features/progress/Progressbar.tsx index c65e27b..50c8d18 100644 --- a/web/src/features/progress/Progressbar.tsx +++ b/web/src/features/progress/Progressbar.tsx @@ -32,9 +32,7 @@ const Progressbar: React.FC = () => { const progressCancel = () => { setCancelled(true); - setTimeout(() => { - setVisible(false); - }, 2500); + setVisible(false); }; useNuiEvent("progressCancel", progressCancel); @@ -77,6 +75,7 @@ const Progressbar: React.FC = () => { animationDuration: `${duration}ms`, } : { + // Currently unused width: "100%", animationPlayState: "paused", backgroundColor: "rgb(198, 40, 40)",