Fixed #4808 - FileUpload: missing fileSizeTypes locale breaks the file select process

pull/4815/head
tugcekucukoglu 2023-11-13 14:50:22 +03:00
parent cc1a630577
commit d8fc74f3c5
2 changed files with 2 additions and 2 deletions

View File

@ -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]}`;

View File

@ -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]}`;