From b09f0741ba2d8aa697b39b34f2bab65990764cb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Fri, 3 May 2019 12:19:35 +0200 Subject: [PATCH] Fix default quota setting of 0 B MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- settings/src/views/Users.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/settings/src/views/Users.vue b/settings/src/views/Users.vue index a878e5fe49a..d88c15a5e0d 100644 --- a/settings/src/views/Users.vue +++ b/settings/src/views/Users.vue @@ -180,16 +180,16 @@ export default { /** * Validate quota string to make sure it's a valid human file size - * + * * @param {string} quota Quota in readable format '5 GB' * @returns {Promise|boolean} */ validateQuota(quota) { // only used for new presets sent through @Tag let validQuota = OC.Util.computerFileSize(quota); - if (validQuota === 0) { + if (validQuota === null) { return this.setDefaultQuota('none'); - } else if (validQuota !== null) { + } else { // unify format output return this.setDefaultQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(quota))); } @@ -295,7 +295,7 @@ export default { if (this.selectedQuota !== false) { return this.selectedQuota; } - if (OC.Util.computerFileSize(this.settings.defaultQuota) > 0) { + if (this.settings.defaultQuota !== this.unlimitedQuota.id && OC.Util.computerFileSize(this.settings.defaultQuota) >= 0) { // if value is valid, let's map the quotaOptions or return custom quota return {id:this.settings.defaultQuota, label:this.settings.defaultQuota}; } -- 2.39.5