diff --git a/src/agenda/reservation-list/index.tsx b/src/agenda/reservation-list/index.tsx index f364d9c835..7d38f98d8d 100644 --- a/src/agenda/reservation-list/index.tsx +++ b/src/agenda/reservation-list/index.tsx @@ -107,13 +107,17 @@ class ReservationList extends Component { } componentDidUpdate(prevProps: ReservationListProps) { - if (this.props.topDay && prevProps.topDay && prevProps !== this.props) { - if (!sameDate(prevProps.topDay, this.props.topDay)) { - this.setState({reservations: []}, - () => this.updateReservations(this.props) - ); - } else { - this.updateReservations(this.props); + if (this.props.topDay && prevProps.topDay) { + if ( + this.props.showOnlySelectedDayItems !== prevProps.showOnlySelectedDayItems || + this.props.items !== prevProps.items || + !sameDate(this.props.selectedDay, prevProps.selectedDay) + ) { + if (!sameDate(prevProps.topDay, this.props.topDay)) { + this.setState({reservations: []}, () => this.updateReservations(this.props)); + } else { + this.updateReservations(this.props); + } } } }