Skip to content

Commit

Permalink
fix: check sortable.el defined or not before invoking destroy method (#…
Browse files Browse the repository at this point in the history
…8416)

Signed-off-by: Pranav C <pranavxc@gmail.com>
  • Loading branch information
pranavxc committed May 9, 2024
1 parent 34a0003 commit 5be970b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/nc-gui/components/cell/attachment/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export function useSortable(
const _element = unref(element)

onCleanup(() => {
if (_element && sortable) sortable.destroy()
if (_element && sortable?.el) {
sortable.destroy()
}
})

if (_element && !unref(isReadonly)) initSortable(_element)
Expand Down

0 comments on commit 5be970b

Please sign in to comment.