Browse Source

fix(file-sharing) fix computing file sharing percentage

Actually implement what the comment says: we want to cap the progress at
99% so we wait for the request to complete with 200 before going to
100%.
j25
Saúl Ibarra Corretgé 3 months ago
parent
commit
1ab7989a1a
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      react/features/file-sharing/middleware.web.ts

+ 1
- 1
react/features/file-sharing/middleware.web.ts View File

@@ -215,7 +215,7 @@ function uploadFile(file: File, store: IStore, token: string): void {
215 215
         if (event.lengthComputable) {
216 216
             // We use 99% as the max value to avoid showing 100% before the
217 217
             // upload is actually finished, that is, when the request is completed.
218
-            const percent = Math.max((event.loaded / event.total) * 100, 99);
218
+            const percent = Math.min((event.loaded / event.total) * 100, 99);
219 219
 
220 220
             store.dispatch(updateFileProgress(fileId, percent));
221 221
         }

Loading…
Cancel
Save