Skip to content

Commit a394e9c

Browse files
committed
Upload Multiple Images using images map
1 parent fa97f99 commit a394e9c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

demo/src/app/tab1/tab1.page.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ declare const FileTransferManager: any;
1818
export class Tab1Page {
1919
uploader: any;
2020

21+
imagesIds: [];
2122
images: Map<number, string> = new Map();
2223
imageUris: Map<number, string> = new Map();
2324
uploadStates: Map<number, UploadState> = new Map();
@@ -145,14 +146,14 @@ export class Tab1Page {
145146
}
146147

147148
onTapUploadButton() {
148-
for (const id of this.uploadStates.keys()) {
149-
if (!this.uploadStates.has(id)) {
149+
for (const [key, value] of this.images) {
150+
if (!this.uploadStates.has(key)) {
150151
// Start upload
151-
this.uploadImage(id);
152+
this.uploadImage(key);
152153
} else {
153154
// Remove download
154-
const state = this.uploadStates.get(id);
155-
this.uploader.removeUpload(id, (res) => {
155+
const state = this.uploadStates.get(key);
156+
this.uploader.removeUpload(key, (res) => {
156157
console.log('Remove result:', res);
157158
this.zone.run(() => {
158159
state.status = UploadStatus.Aborted;

0 commit comments

Comments
 (0)