From d8fc74f3c599663583a15a219727411d4f5b4d2c Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Mon, 13 Nov 2023 14:50:22 +0300 Subject: [PATCH] Fixed #4808 - FileUpload: missing fileSizeTypes locale breaks the file select process --- components/lib/fileupload/FileContent.vue | 2 +- components/lib/fileupload/FileUpload.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/fileupload/FileContent.vue b/components/lib/fileupload/FileContent.vue index ce4f04895..1f086ac9e 100644 --- a/components/lib/fileupload/FileContent.vue +++ b/components/lib/fileupload/FileContent.vue @@ -54,7 +54,7 @@ export default { formatSize(bytes) { const k = 1024; const dm = 3; - const sizes = this.$primevue.config.locale?.fileSizeTypes; + const sizes = this.$primevue.config.locale?.fileSizeTypes || ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; if (bytes === 0) { return `0 ${sizes[0]}`; diff --git a/components/lib/fileupload/FileUpload.vue b/components/lib/fileupload/FileUpload.vue index 5f2c19e5a..6412221aa 100755 --- a/components/lib/fileupload/FileUpload.vue +++ b/components/lib/fileupload/FileUpload.vue @@ -328,7 +328,7 @@ export default { formatSize(bytes) { const k = 1024; const dm = 3; - const sizes = this.$primevue.config.locale?.fileSizeTypes; + const sizes = this.$primevue.config.locale?.fileSizeTypes || ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; if (bytes === 0) { return `0 ${sizes[0]}`;