Skip to content

Commit b113c52

Browse files
committed
fix: fix attachment files check before image re-generation
1 parent cef2c7b commit b113c52

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,9 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
428428
}
429429
const images = await Promise.all(
430430
(new Array(this.options.generateImages[fieldName].countToGenerate)).fill(0).map(async () => {
431-
431+
if (this.options.attachFiles && attachmentFiles.length === 0) {
432+
return null;
433+
}
432434
if (STUB_MODE) {
433435
await new Promise((resolve) => setTimeout(resolve, 2000));
434436
return `https://picsum.photos/200/300?random=${Math.floor(Math.random() * 1000)}`;

0 commit comments

Comments
 (0)