From 99cb003d4de89a2e6d0dda57d63ecc4fb087c2bb Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 5 Sep 2023 03:10:05 +0100 Subject: [PATCH] Refactor #4377 --- components/lib/fileupload/FileContent.vue | 2 +- components/lib/fileupload/FileUpload.vue | 2 +- doc/fileupload/TemplateDoc.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/lib/fileupload/FileContent.vue b/components/lib/fileupload/FileContent.vue index a6df717de..ce4f04895 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; if (bytes === 0) { return `0 ${sizes[0]}`; diff --git a/components/lib/fileupload/FileUpload.vue b/components/lib/fileupload/FileUpload.vue index 25f232aa9..1da081309 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; if (bytes === 0) { return `0 ${sizes[0]}`; diff --git a/doc/fileupload/TemplateDoc.vue b/doc/fileupload/TemplateDoc.vue index 3637a38e6..a0819e921 100644 --- a/doc/fileupload/TemplateDoc.vue +++ b/doc/fileupload/TemplateDoc.vue @@ -317,7 +317,7 @@ const onTemplatedUpload = () => { toast.add({ severity: "info", summary: "Success", detail: "File Uploaded", life: 3000 }); }; -formatSize(bytes) { +const formatSize = (bytes) => { const k = 1024; const dm = 3; const sizes = this.$primevue.config.locale.fileSizeTypes;