From bb23e98b5432fbb0863c63509cb6044d1acd553f Mon Sep 17 00:00:00 2001 From: Jose Manuel Serrano Amaut <a20122128@pucp.pe> Date: Mon, 27 Feb 2023 02:46:21 -0500 Subject: [PATCH] [FIX]: Add conditional to change progress only when progress is diferent --- src/files-ui/components/file-mosaic/hooks/useProgress.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/files-ui/components/file-mosaic/hooks/useProgress.ts b/src/files-ui/components/file-mosaic/hooks/useProgress.ts index ae854a8..0ee6ac2 100644 --- a/src/files-ui/components/file-mosaic/hooks/useProgress.ts +++ b/src/files-ui/components/file-mosaic/hooks/useProgress.ts @@ -15,7 +15,10 @@ const useProgress = ( const [localProgress, setLocalProgress] = React.useState<number | undefined>(undefined); if (progress !== undefined) { - setLocalProgress(progress); + if (localProgress !== progress) { + setLocalProgress(progress); + } + } else { if (xhr !== undefined && xhr !== null && xhr.upload.onprogress === null) { // xhr was given but it was not initialized the `onprogress` event -- GitLab