Skip to content
Snippets Groups Projects
Unverified Commit b09f0741 authored by Julius Härtl's avatar Julius Härtl
Browse files

Fix default quota setting of 0 B


Signed-off-by: default avatarJulius Härtl <jus@bitgrid.net>
parent 3d42d4c9
No related branches found
No related tags found
No related merge requests found
......@@ -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};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment