Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions harmony/pushy/src/main/ets/DownloadTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ export class DownloadTask {
targets.map(t => t.substring(0, t.lastIndexOf('/'))).filter(Boolean),
),
];
for (const dir of parentDirs) {
await this.ensureDirectory(dir);
}
await Promise.all(
parentDirs.map(dir => this.ensureDirectory(dir)),
);
await Promise.all(
targets.map(target => this.writeFileContent(target, mediaBuffer.buffer)),
);
Expand All @@ -541,9 +541,9 @@ export class DownloadTask {
targets.map(t => t.substring(0, t.lastIndexOf('/'))).filter(Boolean),
),
];
for (const dir of parentDirs) {
await this.ensureDirectory(dir);
}
await Promise.all(
parentDirs.map(dir => this.ensureDirectory(dir))
);
if (fileIo.accessSync(firstTarget)) {
await fileIo.unlink(firstTarget);
}
Expand Down