MOBILE-3833 core: Fix download file spinner shown forever

main
Dani Palou 2022-02-24 17:04:34 +01:00
parent 8dbefef88b
commit 8c960d4739
1 changed files with 3 additions and 3 deletions

View File

@ -2603,12 +2603,12 @@ export class CoreFilepoolProvider {
// Success, we add links and remove from queue.
CoreUtils.ignoreErrors(this.addFileLinks(siteId, fileId, links));
this.treatQueueDeferred(siteId, fileId, true);
this.notifyFileDownloaded(siteId, fileId, links);
// Wait for the item to be removed from queue before resolving the promise.
// If the item could not be removed from queue we still resolve the promise.
await CoreUtils.ignoreErrors(this.removeFromQueue(siteId, fileId));
this.treatQueueDeferred(siteId, fileId, true);
this.notifyFileDownloaded(siteId, fileId, links);
} catch (errorObject) {
// Whoops, we have an error...
let dropFromQueue = false;