Skip to content

Commit e534a57

Browse files
committed
fix: block save button when generation in progress
1 parent 6185938 commit e534a57

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

custom/VisionAction.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{
2121
label: checkedCount > 1 ? t('Save fields') : t('Save field'),
2222
options: {
23-
disabled: isLoading || checkedCount < 1 || isCriticalError || isFetchingRecords || isProcessingAny,
23+
disabled: isLoading || checkedCount < 1 || isFetchingRecords || isProcessingAny,
2424
loader: isLoading, class: 'w-fit'
2525
},
2626
onclick: async (dialog) => { await saveData(); dialog.hide(); }
@@ -208,7 +208,6 @@ const primaryKey = props.meta.primaryKey;
208208
const isLoading = ref(false);
209209
const isFetchingRecords = ref(false);
210210
const isError = ref(false);
211-
const isCriticalError = ref(false);
212211
const errorMessage = ref('');
213212
const isDialogOpen = ref(false);
214213
const isImageHasPreviewUrl = ref<Record<string, boolean>>({});
@@ -218,7 +217,10 @@ const isDataSaved = ref(false);
218217
const overwriteExistingValues = ref<boolean>(false);
219218
220219
const checkedCount = computed(() => recordIds.value.length - uncheckedRecordIds.size);
221-
const isProcessingAny = computed(() => Array.from(recordsById.values()).some(record => record.status === 'processing'));
220+
const isProcessingAny = computed(() => {
221+
recordsVersion.value;
222+
return Array.from(recordsById.values()).some(record => record.status === 'processing');
223+
});
222224
223225
const tableHeaders = computed(() => generateTableHeaders(props.meta.outputFields));
224226
const customFieldNames = computed(() => tableHeaders.value.slice((props.meta.isAttachFiles) ? 3 : 2).map(h => h.fieldName));
@@ -299,7 +301,6 @@ const closeDialog = () => {
299301
window.removeEventListener('beforeunload', beforeUnloadHandler);
300302
resetGlobalState();
301303
isError.value = false;
302-
isCriticalError.value = false;
303304
errorMessage.value = '';
304305
isDialogOpen.value = false;
305306
popupMode.value = 'confirmation';

0 commit comments

Comments
 (0)