diff --git a/webapp/src/components/kanban/kanban.tsx b/webapp/src/components/kanban/kanban.tsx index 64fc567ed..190895fcf 100644 --- a/webapp/src/components/kanban/kanban.tsx +++ b/webapp/src/components/kanban/kanban.tsx @@ -66,12 +66,7 @@ const Kanban = (props: Props) => { } }, [activeView.fields.defaultTemplateId]) - if (!groupByProperty) { - Utils.assertFailure('Board views must have groupByProperty set') - return
- } - - const propertyValues = groupByProperty.options || [] + const propertyValues = groupByProperty?.options || [] Utils.log(`${propertyValues.length} propertyValues`) const visiblePropertyTemplates = useMemo(() => { @@ -168,7 +163,7 @@ const Kanban = (props: Props) => { }, [cards, visibleGroups, activeView.id, activeView.fields.cardOrder, groupByProperty, props.selectedCardIds]) const onDropToCard = useCallback(async (srcCard: Card, dstCard: Card) => { - if (srcCard.id === dstCard.id) { + if (srcCard.id === dstCard.id || !groupByProperty) { return } Utils.log(`onDropToCard: ${dstCard.title}`) @@ -217,6 +212,11 @@ const Kanban = (props: Props) => { setShowCalculationsMenu(newShowOptions) } + if (!groupByProperty) { + Utils.assertFailure('Board views must have groupByProperty set') + return + } + return (