Skip to content

Commit

Permalink
Fix broken modal after a page reload
Browse files Browse the repository at this point in the history
  • Loading branch information
mic4ael authored and ThiefMaster committed Apr 25, 2019
1 parent b320db7 commit 8079e80
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -57,11 +57,13 @@ class UnavailableRoomsModal extends React.Component {
timelineDatePicker,
isTimelineVisible
} = this.props;
const selectedDate = isTimelineVisible ? timelineDatePicker.selectedDate : filters.dates.startDate;
const mode = isTimelineVisible ? timelineDatePicker.mode : 'days';

const {selectedDate, mode} = timelineDatePicker;
const initialDate = isTimelineVisible && selectedDate ? selectedDate : filters.dates.startDate;
const initialMode = isTimelineVisible && mode ? mode : 'days';

fetchUnavailableRooms(filters);
initTimeline(selectedDate, mode);
initTimeline(initialDate, initialMode);
}

render() {
Expand Down

0 comments on commit 8079e80

Please sign in to comment.