浏览代码

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 个月前
父节点
当前提交
1ab7989a1a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      react/features/file-sharing/middleware.web.ts

+ 1
- 1
react/features/file-sharing/middleware.web.ts 查看文件

@@ -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
         }

正在加载...
取消
保存