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
This commit is contained in:
Luke
2022-06-14 19:18:24 +02:00
parent f406cebcc8
commit 923a76896b
2 changed files with 6 additions and 16 deletions

View File

@@ -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 && (
<Flex
alignItems= "center"
flexDirection="column"
>
<Flex alignItems="center" flexDirection="column">
<CircularProgress
value={value}
size="5rem"
@@ -99,6 +94,7 @@ const CircleProgressbar: React.FC = () => {
},
}
: {
// 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}%
</CircularProgressLabel>
</CircularProgress>
<Text
fontFamily="Inter"
isTruncated
fontSize={18}
fontWeight="light"
>
<Text fontFamily="Inter" isTruncated fontSize={18} fontWeight="light">
{label}
</Text>
</Flex>

View File

@@ -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)",