Skip to content

Commit fdc5523

Browse files
committed
refactor: update button visibility condition
1 parent 5d15843 commit fdc5523

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

custom/ImportCsv.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ const computedButtons = computed(() => {
5454
if (!importStats.value) return [];
5555
5656
const buttons = [
57-
{ label: t('⚠️ Import All — Replace & Overwrite'), onclick: (dialog) => { confirmImport(dialog) }, vIf: importStats.value.existingCount > 0 && importStats.value.newCount > 0 },
58-
{ label: t('⚠️ Replace Existing Records'), onclick: (dialog) => { confirmImport(dialog) }, vIf: importStats.value.existingCount > 0 && importStats.value.newCount === 0 },
59-
{ label: t('➕ Import New Only'), onclick: (dialog) => { confirmImportNewOnly(dialog) }, vIf: importStats.value.existingCount > 0 && importStats.value.newCount > 0 },
60-
{ label: t('➕ Import Records'), onclick: (dialog) => { confirmImportNewOnly(dialog) }, vIf: importStats.value.existingCount === 0 && importStats.value.newCount > 0 },
57+
{ label: t('⚠️ Import All — Replace & Overwrite'), onclick: (dialog) => { confirmImport(dialog) }, visible: importStats.value.existingCount > 0 && importStats.value.newCount > 0 },
58+
{ label: t('⚠️ Replace Existing Records'), onclick: (dialog) => { confirmImport(dialog) }, visible: importStats.value.existingCount > 0 && importStats.value.newCount === 0 },
59+
{ label: t('➕ Import New Only'), onclick: (dialog) => { confirmImportNewOnly(dialog) }, visible: importStats.value.existingCount > 0 && importStats.value.newCount > 0 },
60+
{ label: t('➕ Import Records'), onclick: (dialog) => { confirmImportNewOnly(dialog) }, visible: importStats.value.existingCount === 0 && importStats.value.newCount > 0 },
6161
{ label: t('✖ Cancel'), onclick: (dialog) => dialog.hide() }
6262
];
6363
64-
return buttons.filter(button => button.vIf !== false);
64+
return buttons.filter(button => button.visible !== false);
6565
});
6666
async function confirmImport(dialog) {
6767
dialog.hide();

0 commit comments

Comments
 (0)