Skip to content

Commit 585c090

Browse files
authored
Merge pull request #15425 from nextcloud/backport/stable15/15359
[stable15] Handle 0 B default quota properly in the web UI
2 parents 523ab14 + 5290686 commit 585c090

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

settings/js/4.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/5.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/5.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/settings-admin-security.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/settings-vue.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/src/views/Users.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ export default {
168168
169169
/**
170170
* Validate quota string to make sure it's a valid human file size
171-
*
171+
*
172172
* @param {string} quota Quota in readable format '5 GB'
173173
* @returns {Promise|boolean}
174174
*/
175175
validateQuota(quota) {
176176
// only used for new presets sent through @Tag
177177
let validQuota = OC.Util.computerFileSize(quota);
178-
if (validQuota === 0) {
178+
if (validQuota === null) {
179179
return this.setDefaultQuota('none');
180-
} else if (validQuota !== null) {
180+
} else {
181181
// unify format output
182182
return this.setDefaultQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(quota)));
183183
}
@@ -280,7 +280,7 @@ export default {
280280
if (this.selectedQuota !== false) {
281281
return this.selectedQuota;
282282
}
283-
if (OC.Util.computerFileSize(this.settings.defaultQuota) > 0) {
283+
if (this.settings.defaultQuota !== this.unlimitedQuota.id && OC.Util.computerFileSize(this.settings.defaultQuota) >= 0) {
284284
// if value is valid, let's map the quotaOptions or return custom quota
285285
return {id:this.settings.defaultQuota, label:this.settings.defaultQuota};
286286
}

0 commit comments

Comments
 (0)