From cb1c2fcd3528f82d7fe64e8bc4ca833489143974 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 18 Nov 2022 10:54:59 +0530 Subject: [PATCH] refactor(api): font size correction and navigation bugs Signed-off-by: Pranav C --- .../nc-gui/components/smartsheet/Grid.vue | 26 +++++++++++-------- packages/nc-gui/composables/useTabs.ts | 2 +- packages/nc-gui/layouts/default.vue | 2 +- .../pages/[projectType]/[projectId]/index.vue | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) 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 {