diff --git a/packages/nc-gui/components/smartsheet/header/Menu.vue b/packages/nc-gui/components/smartsheet/header/Menu.vue index 9f1f909ca0..2bd2acc4d2 100644 --- a/packages/nc-gui/components/smartsheet/header/Menu.vue +++ b/packages/nc-gui/components/smartsheet/header/Menu.vue @@ -14,9 +14,11 @@ import { iconMap, inject, message, + useGlobal, useI18n, useMetas, useNuxtApp, + useProject, useSmartsheetStoreOrThrow, useUndoRedo, } from '#imports' @@ -28,6 +30,10 @@ const emit = defineEmits(['edit', 'addColumn']) const { eventBus } = useSmartsheetStoreOrThrow() +const { includeM2M } = useGlobal() + +const { loadTables } = useProject() + const column = inject(ColumnInj) const reloadDataHook = inject(ReloadViewDataHookInj) @@ -62,6 +68,11 @@ const deleteColumn = () => /** force-reload related table meta if deleted column is a LTAR and not linked to same table */ if (column?.value?.uidt === UITypes.LinkToAnotherRecord && column.value?.colOptions) { await getMeta((column.value?.colOptions as LinkToAnotherRecordType).fk_related_model_id!, true) + + // reload tables if deleted column is mm and include m2m is true + if (includeM2M.value && (column.value?.colOptions as LinkToAnotherRecordType).type === RelationTypes.MANY_TO_MANY) { + loadTables() + } } $e('a:column:delete')