Browse Source

refactor(gui-v2): remove unnecessary optional chaining

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3005/head
Pranav C 2 years ago
parent
commit
40041b8636
  1. 11
      packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue

11
packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue

@ -37,12 +37,13 @@ const columnToValidate = [UITypes.Email, UITypes.URL, UITypes.PhoneNumber]
const uiTypesOptions = computed<typeof uiTypes>(() => { const uiTypesOptions = computed<typeof uiTypes>(() => {
return [ return [
...uiTypes.filter((t) => !isEdit || !t.virtual), ...uiTypes.filter((t) => !isEdit.value || !t.virtual),
...(!isEdit?.value && meta?.value?.columns?.every((c) => !c.pk) ...(!isEdit.value && meta?.value?.columns?.every((c) => !c.pk)
? [ ? [
{ {
name: 'ID', name: UITypes.ID,
icon: 'mdi-identifier', icon: MdiIdentifierIcon,
virtual: 0,
}, },
] ]
: []), : []),
@ -65,7 +66,7 @@ function onCancel() {
// create column meta if it's a new column // create column meta if it's a new column
watchEffect(() => { watchEffect(() => {
if (!isEdit?.value) { if (!isEdit.value) {
generateNewColumnMeta() generateNewColumnMeta()
} }
}) })

Loading…
Cancel
Save