diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 7ce1602d06..fcaa154b32 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -524,19 +524,23 @@ provide(ReloadRowDataHookInj, reloadViewDataHook) watch( view, async (next, old) => { - if (next && next.id !== old?.id) { - // whenever tab changes or view changes save any unsaved data - if (old?.id) { - const oldMeta = await getMeta(old.fk_model_id!) - if (oldMeta) { - await saveOrUpdateRecords({ - viewMetaValue: old, - metaValue: oldMeta as TableType, - data: data.value, - }) + try { + if (next && next.id !== old?.id) { + // whenever tab changes or view changes save any unsaved data + if (old?.id) { + const oldMeta = await getMeta(old.fk_model_id!) + if (oldMeta) { + await saveOrUpdateRecords({ + viewMetaValue: old, + metaValue: oldMeta as TableType, + data: data.value, + }) + } } + await loadData() } - await loadData() + } catch (e) { + console.log(e) } }, { immediate: true }, diff --git a/packages/nc-gui/composables/useTabs.ts b/packages/nc-gui/composables/useTabs.ts index 96746e017c..cf7c3492d4 100644 --- a/packages/nc-gui/composables/useTabs.ts +++ b/packages/nc-gui/composables/useTabs.ts @@ -60,7 +60,7 @@ const [setup, use] = useInjectionState(() => { if (!tab) return - return navigateToTab(tab) + navigateToTab(tab) } }, }) diff --git a/packages/nc-gui/layouts/default.vue b/packages/nc-gui/layouts/default.vue index 669173d8e8..cc836efafa 100644 --- a/packages/nc-gui/layouts/default.vue +++ b/packages/nc-gui/layouts/default.vue @@ -20,7 +20,7 @@ export default {