@@ -330,9 +330,8 @@ async function convertImages(fieldName, img) {
330330
331331
332332async function analyzeFields() {
333+ isAiResponseReceivedAnalize .value = props .checkboxes .map (() => false );
333334 try {
334- isAiResponseReceivedAnalize .value = props .checkboxes .map (() => false );
335-
336335 const res = await callAdminForthApi ({
337336 path: ` /plugin/${props .meta .pluginInstanceId }/analyze ` ,
338337 method: ' POST' ,
@@ -341,8 +340,6 @@ async function analyzeFields() {
341340 },
342341 });
343342
344- isAiResponseReceivedAnalize .value = props .checkboxes .map (() => true );
345-
346343 if (res ?.error ) {
347344 adminforth .alert ({
348345 message: res .error ,
@@ -380,23 +377,20 @@ async function analyzeFields() {
380377 // isCriticalError.value = true;
381378 errorMessage .value = res .error ;
382379 }
380+ isAiResponseReceivedAnalize .value = props .checkboxes .map (() => true );
383381}
384382
385383
386384async function analyzeFieldsNoImages() {
385+ isAiResponseReceivedAnalize .value = props .checkboxes .map (() => false );
387386 try {
388- isAiResponseReceivedAnalize .value = props .checkboxes .map (() => false );
389-
390387 const res = await callAdminForthApi ({
391388 path: ` /plugin/${props .meta .pluginInstanceId }/analyze_no_images ` ,
392389 method: ' POST' ,
393390 body: {
394391 selectedIds: props .checkboxes ,
395392 },
396393 });
397- if (! props .meta .isFieldsForAnalizeFromImages ) {
398- isAiResponseReceivedAnalize .value = props .checkboxes .map (() => true );
399- }
400394 if (res ?.error ) {
401395 adminforth .alert ({
402396 message: res .error ,
@@ -432,6 +426,9 @@ async function analyzeFieldsNoImages() {
432426 // isCriticalError.value = true;
433427 errorMessage .value = ` Failed to analyze fields. Please, try to re-run the action. ` ;
434428 }
429+ if (! props .meta .isFieldsForAnalizeFromImages ) {
430+ isAiResponseReceivedAnalize .value = props .checkboxes .map (() => true );
431+ }
435432}
436433
437434
0 commit comments