diff --git a/packages/nc-gui/components/dashboard/settings/DataSources.vue b/packages/nc-gui/components/dashboard/settings/DataSources.vue index 3319fc36a6..fba38d7856 100644 --- a/packages/nc-gui/components/dashboard/settings/DataSources.vue +++ b/packages/nc-gui/components/dashboard/settings/DataSources.vue @@ -52,6 +52,7 @@ async function loadBases(changed?: boolean) { try { if (changed) refreshCommandPalette() + await until(() => !!project.value.id).toBeTruthy() isReloading.value = true vReload.value = true const baseList = await $api.base.list(project.value.id as string) @@ -164,8 +165,7 @@ const forceAwaken = () => { onMounted(async () => { if (sources.value.length === 0) { - await loadBases() - await loadMetaDiff() + loadBases() } }) @@ -174,7 +174,6 @@ watch( async (reload) => { if (reload && !isReloading.value) { await loadBases() - await loadMetaDiff() } }, ) diff --git a/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue b/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue index 6bb55c0941..9c6e5e5ae2 100644 --- a/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue +++ b/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue @@ -350,8 +350,8 @@ onMounted(async () => { // todo: replace setTimeout and follow better approach setTimeout(() => { const input = form.value?.$el?.querySelector('input[type=text]') - input.setSelectionRange(0, formState.value.title.length) - input.focus() + input?.setSelectionRange(0, formState.value.title.length) + input?.focus() }, 500) }) }) diff --git a/packages/nc-gui/components/dlg/ViewCreate.vue b/packages/nc-gui/components/dlg/ViewCreate.vue index 86557e85c5..185d5bb2e2 100644 --- a/packages/nc-gui/components/dlg/ViewCreate.vue +++ b/packages/nc-gui/components/dlg/ViewCreate.vue @@ -156,7 +156,13 @@ function init() { } async function onSubmit() { - const isValid = await formValidator.value?.validateFields() + let isValid = null + + try { + isValid = await formValidator.value?.validateFields() + } catch (e) { + console.error(e) + } if (isValid && form.type) { const _meta = unref(meta) diff --git a/packages/nc-gui/components/nc/Button.vue b/packages/nc-gui/components/nc/Button.vue index b6d594faa1..70cf2ebaee 100644 --- a/packages/nc-gui/components/nc/Button.vue +++ b/packages/nc-gui/components/nc/Button.vue @@ -33,6 +33,8 @@ const emits = defineEmits(['update:loading']) const slots = useSlots() +const NcButton = ref(null) + const size = computed(() => props.size) const type = computed(() => props.type) @@ -63,10 +65,15 @@ const onBlur = () => { isFocused.value = false isClicked.value = false } + +useEventListener(NcButton, 'mousedown', () => { + isClicked.value = true +})