Browse Source

fix: load model meta once per navigation

pull/6645/head
mertmit 1 year ago
parent
commit
7a1599551f
  1. 4
      packages/nc-gui/composables/useTableNew.ts
  2. 2
      packages/nc-gui/pages/index/[typeOrId]/[baseId]/index/index/[viewId]/[[viewTitle]].vue

4
packages/nc-gui/composables/useTableNew.ts

@ -82,6 +82,8 @@ export function useTableNew(param: { onTableCreate?: (tableMeta: TableType) => v
const views = viewsByTable.value.get(table.id as string) ?? []
getMeta(table.id as string, (route.value.params?.viewId as string) !== table.id)
if (openedViewsTab.value !== 'view' && views[0].id) {
await navigateTo({
path: `/${workspaceIdOrType}/${baseIdOrBaseId}/${table?.id}/${views[0].id}/${openedViewsTab.value}`,
@ -92,8 +94,6 @@ export function useTableNew(param: { onTableCreate?: (tableMeta: TableType) => v
path: `/${workspaceIdOrType}/${baseIdOrBaseId}/${table?.id}`,
query: route.value.query,
})
await getMeta(table.id as string)
}
const createTable = async () => {

2
packages/nc-gui/pages/index/[typeOrId]/[baseId]/index/index/[viewId]/[[viewTitle]].vue

@ -20,7 +20,7 @@ watch(
until(tables)
.toMatch((tables) => tables.length > 0)
.then(() => {
getMeta(viewId as string, true)
getMeta(viewId as string)
})
},
{ immediate: true },

Loading…
Cancel
Save