Skip to content

Commit e423f40

Browse files
Merge pull request #45 from linked-planet/dev
time table - notifies outside if selection was set to null, valtio 2.0
2 parents 0556e2a + 5a5e49f commit e423f40

File tree

4 files changed

+117
-272
lines changed

4 files changed

+117
-272
lines changed

library/src/components/timetable/TimeTable.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ const LPTimeTableImpl = <G extends TimeTableGroup, I extends TimeSlotBooking>({
238238
!disableMessages,
239239
)
240240

241+
useEffect(() => {
242+
console.log("START DATE", startDate.format(), endDate.format())
243+
}, [startDate, endDate])
244+
241245
// change on viewType
242246
useEffect(() => {
243247
setMessage?.(undefined) // clear the message on time frame change

library/src/components/timetable/TimeTableSelectionStore.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,10 @@ export function clearTimeSlotSelection(
223223
`TimeTable - no time table selection store to clear found for ident: ${ident}`,
224224
)
225225
}
226-
const needsNotify =
227-
store.selection.selectedTimeSlots?.length && needsNotification
228226
store.selection.selectedTimeSlots = null
229227
store.selection.groupId = null
230228
store.multiSelectionMode = false
231-
if (needsNotify) {
229+
if (needsNotification) {
232230
notifyOnTimeRangeSelected(ident)
233231
}
234232
}

0 commit comments

Comments
 (0)