From c020561a72952e3720ebdb2ad220c4bb274c3e1c Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 8 Feb 2024 15:45:58 -0800 Subject: [PATCH] fix(settings): Fix incorrect user quota on page reload in non-English locales Signed-off-by: Christopher Ng --- apps/settings/src/components/UserList.vue | 5 ++--- apps/settings/src/components/UserList/UserRow.vue | 7 +++---- apps/settings/src/store/users.js | 3 +-- core/js/tests/specs/coreSpec.js | 2 +- core/src/OC/util.js | 6 +++++- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/apps/settings/src/components/UserList.vue b/apps/settings/src/components/UserList.vue index f9553445e13..9a97aff085f 100644 --- a/apps/settings/src/components/UserList.vue +++ b/apps/settings/src/components/UserList.vue @@ -262,7 +262,6 @@ import Vue from 'vue' import NcModal from '@nextcloud/vue/dist/Components/NcModal.js' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect.js' -import { formatFileSize, parseFileSize } from '@nextcloud/files' import userRow from './UserList/UserRow.vue' @@ -487,10 +486,10 @@ export default { */ validateQuota(quota) { // only used for new presets sent through @Tag - const validQuota = parseFileSize(quota, true) + const validQuota = OC.Util.computerFileSize(quota) if (validQuota !== null && validQuota >= 0) { // unify format output - quota = formatFileSize(parseFileSize(quota, true)) + quota = OC.Util.humanFileSize(OC.Util.computerFileSize(quota)) this.newUser.quota = { id: quota, label: quota } return this.newUser.quota } diff --git a/apps/settings/src/components/UserList/UserRow.vue b/apps/settings/src/components/UserList/UserRow.vue index 2e507107b73..aff5d7dd37e 100644 --- a/apps/settings/src/components/UserList/UserRow.vue +++ b/apps/settings/src/components/UserList/UserRow.vue @@ -268,7 +268,6 @@