diff --git a/apps/web/src/components/editor/picker.ts b/apps/web/src/components/editor/picker.ts index 5da44f7aa..6d61b8807 100644 --- a/apps/web/src/components/editor/picker.ts +++ b/apps/web/src/components/editor/picker.ts @@ -240,14 +240,13 @@ function withProgress( ({ type, total, loaded }: AttachmentProgress) => { if (type !== "encrypt") return; report({ - current: loaded, - total: total, + current: Math.round((loaded / total) * 100), + total: 100, text: file.name }); } ); - event.unsubscribe(); - return action(); + return action().finally(() => event.unsubscribe()); } }); }