remove from progress section instead of adding to result list

This commit is contained in:
Abhinav 2022-09-24 12:35:30 +05:30
parent d8b9e81f49
commit 9c683dfea5
2 changed files with 5 additions and 4 deletions

View file

@ -70,6 +70,10 @@ class UIService {
this.updateProgressBarUI(); this.updateProgressBarUI();
} }
removeFromInProgressList(key: number) {
this.inProgressUploads.delete(key);
}
moveFileToResultList(key: number, uploadResult: UPLOAD_RESULT) { moveFileToResultList(key: number, uploadResult: UPLOAD_RESULT) {
this.finishedUploads.set(key, uploadResult); this.finishedUploads.set(key, uploadResult);
this.inProgressUploads.delete(key); this.inProgressUploads.delete(key);

View file

@ -305,10 +305,6 @@ class UploadManager {
file file
)} ` )} `
); );
UIService.moveFileToResultList(
localID,
UPLOAD_RESULT.UPLOADED
);
} catch (e) { } catch (e) {
if (e.message === CustomError.UPLOAD_CANCELLED) { if (e.message === CustomError.UPLOAD_CANCELLED) {
throw e; throw e;
@ -327,6 +323,7 @@ class UploadManager {
metadata: metadata && { ...metadata }, metadata: metadata && { ...metadata },
filePath: filePath, filePath: filePath,
}); });
UIService.removeFromInProgressList(localID);
UIService.increaseFileUploaded(); UIService.increaseFileUploaded();
} }
} catch (e) { } catch (e) {