Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(file-sharing) fix computing file sharing percentage

Saúl Ibarra Corretgé1ab7989a1a0c
diff --git a/react/features/file-sharing/middleware.web.ts b/react/features/file-sharing/middleware.web.ts
index 01260f0eb9..617ac0a8c1 100644
--- a/react/features/file-sharing/middleware.web.ts
+++ b/react/features/file-sharing/middleware.web.ts
@@ -215,7 +215,7 @@ function uploadFile(file: File, store: IStore, token: string): void {
if (event.lengthComputable) {
// We use 99% as the max value to avoid showing 100% before the
// upload is actually finished, that is, when the request is completed.
- const percent = Math.max((event.loaded / event.total) * 100, 99);
+ const percent = Math.min((event.loaded / event.total) * 100, 99);
store.dispatch(updateFileProgress(fileId, percent));
}