save download count changes to localStorage. fixes #1080

This commit is contained in:
Danny Coates 2019-01-15 10:11:51 -08:00
parent 6e175dd5ca
commit 783d7bfa03
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
3 changed files with 22 additions and 17 deletions

View file

@ -157,6 +157,9 @@ class Storage {
const workingFiles = this.files.slice();
for (const f of workingFiles) {
const cc = await f.updateDownloadCount();
if (cc) {
await this.writeFile(f);
}
downloadCount = downloadCount || cc;
outgoing = outgoing || f.expired;
if (f.expired) {