From 2e3ab0ce40ac0ac9a6e5b4f1b724212ceefe75d3 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 19 Jan 2024 09:20:15 +0000 Subject: [PATCH] fix: sortable bug --- packages/nc-gui/components/dashboard/TreeView/ViewsList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui/components/dashboard/TreeView/ViewsList.vue b/packages/nc-gui/components/dashboard/TreeView/ViewsList.vue index f5d595e617..5a9eb302aa 100644 --- a/packages/nc-gui/components/dashboard/TreeView/ViewsList.vue +++ b/packages/nc-gui/components/dashboard/TreeView/ViewsList.vue @@ -158,7 +158,7 @@ async function onSortEnd(evt: SortableEvent, undo = false) { if (!currentItem || !currentItem.id) return - const previousItem = (previousEl ? views.value.find((v) => v.id === previousEl.id) : {}) as ViewType + const previousItem = (previousEl ? views.value.find((v) => v.id === previousEl.id) ?? { order: 0 } : {}) as ViewType const nextItem = (nextEl ? views.value.find((v) => v.id === nextEl.id) : {}) as ViewType let nextOrder: number