Browse Source

refactor: review comments

pull/9112/head
Pranav C 4 months ago
parent
commit
42d1dee7ae
  1. 1
      packages/nc-gui/composables/useExtensions.ts
  2. 39
      packages/nc-gui/composables/useViewColumns.ts

1
packages/nc-gui/composables/useExtensions.ts

@ -203,7 +203,6 @@ export const useExtensions = createSharedComposable(() => {
} }
} catch (e) { } catch (e) {
console.log(e) console.log(e)
// TODO: Handle error
} }
} }

39
packages/nc-gui/composables/useViewColumns.ts

@ -434,27 +434,26 @@ const [useProvideViewColumns, useViewColumns] = useInjectionState(
scope: defineViewScope({ view: view.value }), scope: defineViewScope({ view: view.value }),
}) })
} }
try { try {
// sync with server if allowed // sync with server if allowed
if (!isPublic.value && isUIAllowed('viewFieldEdit') && gridViewCols.value[id]?.id) { if (!isPublic.value && isUIAllowed('viewFieldEdit') && gridViewCols.value[id]?.id) {
await $api.dbView.gridColumnUpdate(gridViewCols.value[id].id as string, { await $api.dbView.gridColumnUpdate(gridViewCols.value[id].id as string, {
...props, ...props,
}) })
} }
if (gridViewCols.value?.[id]) {
Object.assign(gridViewCols.value[id], {
...gridViewCols.value[id],
...props,
})
} else {
// fallback to reload
await loadViewColumns()
}
}catch (e) {
}
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( watch(

Loading…
Cancel
Save