From 42d1dee7ae335e033335a8a90284d31ac2dd2b05 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 30 Jul 2024 20:35:34 +0000 Subject: [PATCH] refactor: review comments --- packages/nc-gui/composables/useExtensions.ts | 1 - packages/nc-gui/composables/useViewColumns.ts | 39 +++++++++---------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/packages/nc-gui/composables/useExtensions.ts b/packages/nc-gui/composables/useExtensions.ts index d69e217f35..664fc881ce 100644 --- a/packages/nc-gui/composables/useExtensions.ts +++ b/packages/nc-gui/composables/useExtensions.ts @@ -203,7 +203,6 @@ export const useExtensions = createSharedComposable(() => { } } catch (e) { console.log(e) - // TODO: Handle error } } diff --git a/packages/nc-gui/composables/useViewColumns.ts b/packages/nc-gui/composables/useViewColumns.ts index 235a1b6bba..fb9a4ed516 100644 --- a/packages/nc-gui/composables/useViewColumns.ts +++ b/packages/nc-gui/composables/useViewColumns.ts @@ -434,27 +434,26 @@ const [useProvideViewColumns, useViewColumns] = useInjectionState( scope: defineViewScope({ view: view.value }), }) } -try { - // sync with server if allowed - if (!isPublic.value && isUIAllowed('viewFieldEdit') && gridViewCols.value[id]?.id) { - await $api.dbView.gridColumnUpdate(gridViewCols.value[id].id as string, { - ...props, - }) - } - - if (gridViewCols.value?.[id]) { - Object.assign(gridViewCols.value[id], { - ...gridViewCols.value[id], - ...props, - }) - } else { - // fallback to reload - await loadViewColumns() - } -}catch (e) { - -} + try { + // sync with server if allowed + if (!isPublic.value && isUIAllowed('viewFieldEdit') && gridViewCols.value[id]?.id) { + await $api.dbView.gridColumnUpdate(gridViewCols.value[id].id as string, { + ...props, + }) + } + if (gridViewCols.value?.[id]) { + Object.assign(gridViewCols.value[id], { + ...gridViewCols.value[id], + ...props, + }) + } else { + // fallback to reload + await loadViewColumns() + } + } catch (e) { + console.error(e) + } } watch(