From 7be564495226bc6846289a56edb8893511036c6e Mon Sep 17 00:00:00 2001 From: Alex Yong Date: Tue, 30 Jul 2024 16:11:44 -0400 Subject: [PATCH 1/2] fix: fixing an issue where the upload indicator would "jump" around in the UI (#3354) --- frontend/src/stores/upload.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/stores/upload.ts b/frontend/src/stores/upload.ts index 4e814454..60dfdb8a 100644 --- a/frontend/src/stores/upload.ts +++ b/frontend/src/stores/upload.ts @@ -15,11 +15,14 @@ const beforeUnload = (event: Event) => { // Utility function to format bytes into a readable string function formatSize(bytes: number): string { - if (bytes === 0) return "0 Bytes"; + if (bytes === 0) return "0.00 Bytes"; + const k = 1024; const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; - const i = Math.floor(Math.log(bytes) / Math.log(1024)); - return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + " " + sizes[i]; + const i = Math.floor(Math.log(bytes) / Math.log(k)); + + // Return the rounded size with two decimal places + return (bytes / k ** i).toFixed(2) + " " + sizes[i]; } export const useUploadStore = defineStore("upload", { From 21783ed91a13ad52afdb411e43faf14fb6ef6e42 Mon Sep 17 00:00:00 2001 From: Daniel <47092714+Daniel-dev22@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:14:41 -0400 Subject: [PATCH 2/2] fix: pull down to refresh within editor (#3378) Co-authored-by: Oleg Lobanov --- frontend/src/views/files/Editor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/files/Editor.vue b/frontend/src/views/files/Editor.vue index 1654937e..214d8d4f 100644 --- a/frontend/src/views/files/Editor.vue +++ b/frontend/src/views/files/Editor.vue @@ -1,5 +1,5 @@