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>(() => {
return [
...uiTypes.filter((t) => !isEdit || !t.virtual),
...(!isEdit?.value && meta?.value?.columns?.every((c) => !c.pk)
...uiTypes.filter((t) => !isEdit.value || !t.virtual),
...(!isEdit.value && meta?.value?.columns?.every((c) => !c.pk)
? [
{
name: 'ID',
icon: 'mdi-identifier',
name: UITypes.ID,
icon: MdiIdentifierIcon,
virtual: 0,
},
]
: []),
@ -65,7 +66,7 @@ function onCancel() {
// create column meta if it's a new column
watchEffect(() => {
if (!isEdit?.value) {
if (!isEdit.value) {
generateNewColumnMeta()
}
})

Loading…
Cancel
Save