Skip to content

Commit

Permalink
Upload Multiple Images using images map
Browse files Browse the repository at this point in the history
  • Loading branch information
zfir committed Apr 8, 2022
1 parent fa97f99 commit a394e9c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions demo/src/app/tab1/tab1.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ declare const FileTransferManager: any;
export class Tab1Page {
uploader: any;

imagesIds: [];
images: Map<number, string> = new Map();
imageUris: Map<number, string> = new Map();
uploadStates: Map<number, UploadState> = new Map();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a394e9c

Please sign in to comment.