Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ class DayColumn extends React.Component {
this.clearTimeIndicatorInterval()

if (this.props.isNow) {
this.setTimeIndicatorPositionUpdateInterval(
const tail =
this.props.getNow === this.props.getNow &&
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't compare the function but the result of the function. e.g the actual now value. Also you are comparing getNow with it self here...

I don't actually think this is needed, it should already update if now changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't work in a scenario when isNow doesn't change, but getNow does, because few lines earlier there's a check if isNow has changed:
https://github.com/intljusticemission/react-big-calendar/blob/1c101aae13f4a16426685208ab7403ba05c4c378/src/DayColumn.js#L47

Also you are comparing getNow with it self here...

My bad, meant to compare it with previous value 😉
Check out the second commit, I've restructured the code a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jquense any updates on this one?

dates.eq(prevProps.date, this.props.date, 'minutes') &&
prevState.timeIndicatorPosition === this.state.timeIndicatorPosition
)

this.setTimeIndicatorPositionUpdateInterval(tail)
}
}
}
Expand Down