mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-07-09 17:42:59 +00:00
fix: Upload progress size calculation
This commit is contained in:
parent
65bbf44e3c
commit
e423395ef0
@ -74,7 +74,12 @@ export const useUploadStore = defineStore("upload", {
|
||||
if (state.progress.length === 0 || state.sizes.length === 0) {
|
||||
return "0 Bytes";
|
||||
}
|
||||
const sum = state.progress.reduce((acc, val) => +acc + +val, 0) as number;
|
||||
const sum = state.progress.reduce(
|
||||
(sum, p, i) =>
|
||||
(sum as number) +
|
||||
(typeof p === "number" ? p : p ? state.sizes[i] : 0),
|
||||
0
|
||||
) as number;
|
||||
return formatSize(sum);
|
||||
},
|
||||
getTotalSize: (state) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user