From a394e9cffa70b361d6fd3849df428e3faa4db37e Mon Sep 17 00:00:00 2001 From: Sk Heerah Zafir Date: Fri, 8 Apr 2022 11:54:29 +0400 Subject: [PATCH] Upload Multiple Images using images map --- demo/src/app/tab1/tab1.page.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/demo/src/app/tab1/tab1.page.ts b/demo/src/app/tab1/tab1.page.ts index f7bf2966..3c311a08 100644 --- a/demo/src/app/tab1/tab1.page.ts +++ b/demo/src/app/tab1/tab1.page.ts @@ -18,6 +18,7 @@ declare const FileTransferManager: any; export class Tab1Page { uploader: any; + imagesIds: []; images: Map = new Map(); imageUris: Map = new Map(); uploadStates: Map = new Map(); @@ -145,14 +146,14 @@ export class Tab1Page { } onTapUploadButton() { - for (const id of this.uploadStates.keys()) { - if (!this.uploadStates.has(id)) { + for (const [key, value] of this.images) { + if (!this.uploadStates.has(key)) { // Start upload - this.uploadImage(id); + this.uploadImage(key); } else { // Remove download - const state = this.uploadStates.get(id); - this.uploader.removeUpload(id, (res) => { + const state = this.uploadStates.get(key); + this.uploader.removeUpload(key, (res) => { console.log('Remove result:', res); this.zone.run(() => { state.status = UploadStatus.Aborted;