From 062e2a67cb37d0e7b498fe02f7cc748730deb5cc Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 16 Aug 2022 17:22:42 +0530 Subject: [PATCH] fix(gui-v2): if bt/hm cell value is null/undefined treat it as empty array re #3176 Signed-off-by: Pranav C --- packages/nc-gui-v2/components/virtual-cell/HasMany.vue | 8 ++++---- packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui-v2/components/virtual-cell/HasMany.vue b/packages/nc-gui-v2/components/virtual-cell/HasMany.vue index f565dec83c..075d2f1777 100644 --- a/packages/nc-gui-v2/components/virtual-cell/HasMany.vue +++ b/packages/nc-gui-v2/components/virtual-cell/HasMany.vue @@ -49,9 +49,9 @@ await loadRelatedTableMeta() const localCellValue = computed(() => { if (cellValue?.value) { - return cellValue?.value + return cellValue?.value ?? [] } else if (isNew.value) { - return state?.value?.[column?.value.title as string] + return state?.value?.[column?.value.title as string] ?? [] } return [] }) @@ -83,8 +83,8 @@ const unlinkRef = async (rec: Record) => {
diff --git a/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue b/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue index ef274f5e62..a5bc3ffbdc 100644 --- a/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue +++ b/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue @@ -49,9 +49,9 @@ await loadRelatedTableMeta() const localCellValue = computed(() => { if (cellValue?.value) { - return cellValue?.value + return cellValue?.value ?? [] } else if (isNew.value) { - return state?.value?.[column?.value.title as string] + return state?.value?.[column?.value.title as string] ?? [] } return [] })