Skip to content

Commit

Permalink
Merge pull request #45 from linked-planet/dev
Browse files Browse the repository at this point in the history
time table - notifies outside if selection was set to null, valtio 2.0
  • Loading branch information
marcus-wishes authored Sep 20, 2024
2 parents 0556e2a + 5a5e49f commit e423f40
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 272 deletions.
4 changes: 4 additions & 0 deletions library/src/components/timetable/TimeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ const LPTimeTableImpl = <G extends TimeTableGroup, I extends TimeSlotBooking>({
!disableMessages,
)

useEffect(() => {
console.log("START DATE", startDate.format(), endDate.format())
}, [startDate, endDate])

// change on viewType
useEffect(() => {
setMessage?.(undefined) // clear the message on time frame change
Expand Down
4 changes: 1 addition & 3 deletions library/src/components/timetable/TimeTableSelectionStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,10 @@ export function clearTimeSlotSelection(
`TimeTable - no time table selection store to clear found for ident: ${ident}`,
)
}
const needsNotify =
store.selection.selectedTimeSlots?.length && needsNotification
store.selection.selectedTimeSlots = null
store.selection.groupId = null
store.multiSelectionMode = false
if (needsNotify) {
if (needsNotification) {
notifyOnTimeRangeSelected(ident)
}
}
Expand Down
Loading

0 comments on commit e423f40

Please sign in to comment.