Skip to content

Commit 984c8ec

Browse files
Merge pull request #59 from linked-planet/dev
Dev
2 parents aa64368 + c013843 commit 984c8ec

File tree

4 files changed

+396
-240
lines changed

4 files changed

+396
-240
lines changed

library/src/components/timetable/TimeTableRows.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
createRef,
55
type MouseEvent,
66
useCallback,
7+
useEffect,
78
useLayoutEffect,
89
useMemo,
910
useRef,
@@ -162,6 +163,7 @@ export default function TimeTableRows<
162163

163164
// initial run
164165
useLayoutEffect(handleIntersections, [groupRows])
166+
useEffect(handleIntersections, [])
165167

166168
// handle intersection observer, create new observer if the intersectionContainerRef changes
167169
useLayoutEffect(() => {
@@ -183,7 +185,10 @@ export default function TimeTableRows<
183185
}
184186
}, [handleIntersectionsDebounced, intersectionContainerRef.current])
185187

186-
if (!entries) return []
188+
if (!entries || entries.length === 0) {
189+
console.log("TimeTable - no entries")
190+
return []
191+
}
187192
return entries.map((groupEntry, g) => {
188193
const rows = groupRows[groupEntry.group.id]
189194
let mref = refCollection.current[g]

0 commit comments

Comments
 (0)