@adminforth/bulk-ai-flow 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -383,6 +383,9 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
383
383
  attachmentFiles = yield this.options.attachFiles({ record });
384
384
  }
385
385
  const images = yield Promise.all((new Array(this.options.generateImages[fieldName].countToGenerate)).fill(0).map(() => __awaiter(this, void 0, void 0, function* () {
386
+ if (this.options.attachFiles && attachmentFiles.length === 0) {
387
+ return null;
388
+ }
386
389
  if (STUB_MODE) {
387
390
  yield new Promise((resolve) => setTimeout(resolve, 2000));
388
391
  return `https://picsum.photos/200/300?random=${Math.floor(Math.random() * 1000)}`;
package/index.ts CHANGED
@@ -428,7 +428,9 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
428
428
  }
429
429
  const images = await Promise.all(
430
430
  (new Array(this.options.generateImages[fieldName].countToGenerate)).fill(0).map(async () => {
431
-
431
+ if (this.options.attachFiles && attachmentFiles.length === 0) {
432
+ return null;
433
+ }
432
434
  if (STUB_MODE) {
433
435
  await new Promise((resolve) => setTimeout(resolve, 2000));
434
436
  return `https://picsum.photos/200/300?random=${Math.floor(Math.random() * 1000)}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },