Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: close modal on base delete

mertmit20c21be1f828
diff --git a/packages/nc-gui/components/dlg/Table/Create.vue b/packages/nc-gui/components/dlg/Table/Create.vue
index bb41653eef..43c6f1bd4f 100644
--- a/packages/nc-gui/components/dlg/Table/Create.vue
+++ b/packages/nc-gui/components/dlg/Table/Create.vue
@@ -42,7 +42,9 @@ const customSourceId = computed(() => {
const workspaceStore = useWorkspace()
-const { isMysql, isPg, isSnowflake } = useBase()
+const baseStore = useBase()
+const { isMysql, isPg, isSnowflake } = baseStore
+const { baseId } = storeToRefs(baseStore)
const { loadProjectTables, addTable } = useTablesStore()
@@ -423,6 +425,12 @@ const handleRefreshOnError = () => {
default:
}
}
+
+watch(baseId, () => {
+ if (baseId.value !== props.baseId) {
+ dialogShow.value = false
+ }
+})
</script>
<template>
diff --git a/packages/nc-gui/components/dlg/View/Create.vue b/packages/nc-gui/components/dlg/View/Create.vue
index a0f82922e5..b66f3dfe72 100644
--- a/packages/nc-gui/components/dlg/View/Create.vue
+++ b/packages/nc-gui/components/dlg/View/Create.vue
@@ -83,6 +83,9 @@ const { metas, getMeta } = useMetas()
const workspaceStore = useWorkspace()
+const baseStore = useBase()
+const { baseId: activeBaseId } = storeToRefs(baseStore)
+
const { viewsByTable } = storeToRefs(useViewsStore())
const { refreshCommandPalette } = useCommandPalette()
@@ -804,6 +807,12 @@ const getPluralName = (name: string) => {
}
return name
}
+
+watch(activeBaseId, () => {
+ if (activeBaseId.value !== props.baseId) {
+ vModel.value = false
+ }
+})
</script>
<template>