Skip to content

Commit

Permalink
Merge pull request #11191 from nikkuAg/storage-slider
Browse files Browse the repository at this point in the history
Set default value for storage limit slider
  • Loading branch information
rtibbles authored Sep 25, 2023
2 parents 7b61c25 + cb2d9dd commit 6de19e1
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
allowLearnerDownloadResources: null,
setLimitForAutodownload: null,
limitForAutodownload: '0',
freeSpace: 0,
freeSpace: null,
deviceUrls: [],
showChangePrimaryLocationModal: false,
showAddStorageLocationModal: false,
Expand Down Expand Up @@ -565,7 +565,7 @@
},
created() {
this.setDeviceURLs();
this.setFreeSpace();
if (this.freeSpace === null) this.setFreeSpace();
},
beforeMount() {
this.getDeviceSettings()
Expand Down Expand Up @@ -640,7 +640,17 @@
}
this.allowLearnerDownloadResources = allow_learner_download_resources;
this.enableAutomaticDownload = enable_automatic_download;
this.limitForAutodownload = limit_for_autodownload.toString();
if (set_limit_for_autodownload === false) {
if (this.freeSpace === null) {
this.setFreeSpace().then(() => {
this.limitForAutodownload = parseInt(this.freeSpace * 0.8).toString();
});
} else {
this.limitForAutodownload = parseInt(this.freeSpace * 0.8).toString();
}
} else {
this.limitForAutodownload = limit_for_autodownload.toString();
}
this.setLimitForAutodownload = set_limit_for_autodownload;
},
getContentSettings() {
Expand Down

0 comments on commit 6de19e1

Please sign in to comment.