From 951ab7a999a58f80b530ce05488d2c6cec5924d5 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 5 Oct 2023 16:19:26 +0200 Subject: fix(files): Show correct quota size (file size base 2) Signed-off-by: Ferdinand Thiessen --- apps/files/src/components/FileEntry.vue | 2 +- apps/files/src/components/FilesListFooter.vue | 4 ++-- apps/files/src/components/NavigationQuota.vue | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'apps/files') diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index 6509e3b3bce..b15b1bb1a11 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -261,7 +261,7 @@ export default Vue.extend({ if (typeof size !== 'number' || size < 0) { return this.t('files', 'Pending') } - return formatFileSize(size, true) + return formatFileSize(size, true, true).replace('iB', 'B') }, sizeOpacity() { const size = parseInt(this.source.size, 10) || 0 diff --git a/apps/files/src/components/FilesListFooter.vue b/apps/files/src/components/FilesListFooter.vue index 80047f404fc..b67b8163ae3 100644 --- a/apps/files/src/components/FilesListFooter.vue +++ b/apps/files/src/components/FilesListFooter.vue @@ -127,11 +127,11 @@ export default Vue.extend({ totalSize() { // If we have the size already, let's use it if (this.currentFolder?.size) { - return formatFileSize(this.currentFolder.size, true) + return formatFileSize(this.currentFolder.size, true, true).replace('iB', 'B') } // Otherwise let's compute it - return formatFileSize(this.nodes.reduce((total, node) => total + node.size || 0, 0), true) + return formatFileSize(this.nodes.reduce((total, node) => total + node.size || 0, 0), true, true).replace('iB', 'B') }, }, diff --git a/apps/files/src/components/NavigationQuota.vue b/apps/files/src/components/NavigationQuota.vue index d38d4d2fd9e..6644d7446ee 100644 --- a/apps/files/src/components/NavigationQuota.vue +++ b/apps/files/src/components/NavigationQuota.vue @@ -51,8 +51,8 @@ export default { computed: { storageStatsTitle() { - const usedQuotaByte = formatFileSize(this.storageStats?.used) - const quotaByte = formatFileSize(this.storageStats?.quota) + const usedQuotaByte = formatFileSize(this.storageStats?.used, false, true).replace('iB', 'B') + const quotaByte = formatFileSize(this.storageStats?.quota, false, true).replace('iB', 'B') // If no quota set if (this.storageStats?.quota < 0) { -- cgit v1.2.3