web: fix encryption progress when attaching files

This commit is contained in:
Abdullah Atta
2024-07-24 12:35:01 +05:00
committed by Abdullah Atta
parent f1111191b1
commit cdcdc43cad

View File

@@ -240,14 +240,13 @@ function withProgress<T>(
({ 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());
}
});
}