]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix default quota setting of 0 B
authorJulius Härtl <jus@bitgrid.net>
Fri, 3 May 2019 10:19:35 +0000 (12:19 +0200)
committerJulius Härtl <jus@bitgrid.net>
Fri, 3 May 2019 10:19:35 +0000 (12:19 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
settings/src/views/Users.vue

index a878e5fe49a0294d64736829169f12865cbc5702..d88c15a5e0df6ad7a78275c1386bebd613659959 100644 (file)
@@ -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};
                                }