Browse Source

fix: refresh table list on fail

pull/6997/head
mertmit 10 months ago
parent
commit
e735aa8076
  1. 7
      packages/nc-gui/components/dlg/AirtableImport.vue

7
packages/nc-gui/components/dlg/AirtableImport.vue

@ -90,8 +90,10 @@ const onStatus = async (status: JobStatus, data?: any) => {
refreshCommandPalette() refreshCommandPalette()
// TODO: add tab of the first table // TODO: add tab of the first table
} else if (status === JobStatus.FAILED) { } else if (status === JobStatus.FAILED) {
await loadTables()
goBack.value = true goBack.value = true
pushProgress(data.error.message, status) pushProgress(data.error.message, status)
refreshCommandPalette()
} }
} }
@ -115,7 +117,10 @@ const { validateInfos } = useForm(syncSource, validators)
const disableImportButton = computed(() => !syncSource.value.details.apiKey || !syncSource.value.details.syncSourceUrlOrId) const disableImportButton = computed(() => !syncSource.value.details.apiKey || !syncSource.value.details.syncSourceUrlOrId)
const isLoading = ref(false)
async function saveAndSync() { async function saveAndSync() {
isLoading.value = true
await createOrUpdate() await createOrUpdate()
await sync() await sync()
} }
@ -178,6 +183,7 @@ async function listenForUpdates(id?: string) {
} }
} else { } else {
listeningForUpdates.value = false listeningForUpdates.value = false
isLoading.value = false
} }
}, },
) )
@ -494,6 +500,7 @@ onMounted(async () => {
v-e="['c:sync-airtable:save-and-sync']" v-e="['c:sync-airtable:save-and-sync']"
type="primary" type="primary"
class="nc-btn-airtable-import" class="nc-btn-airtable-import"
:loading="isLoading"
:disabled="disableImportButton" :disabled="disableImportButton"
@click="saveAndSync" @click="saveAndSync"
> >

Loading…
Cancel
Save