Merge pull request #591 from matrix-org/luke/fix-wantsdateseparator-performance
Fix performance issues with wantsDateSeperator
This commit is contained in:
commit
238a30789f
1 changed files with 3 additions and 3 deletions
|
@ -21,6 +21,8 @@ var sdk = require('../../index');
|
||||||
|
|
||||||
var MatrixClientPeg = require('../../MatrixClientPeg')
|
var MatrixClientPeg = require('../../MatrixClientPeg')
|
||||||
|
|
||||||
|
const MILLIS_IN_DAY = 86400000;
|
||||||
|
|
||||||
/* (almost) stateless UI component which builds the event tiles in the room timeline.
|
/* (almost) stateless UI component which builds the event tiles in the room timeline.
|
||||||
*/
|
*/
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
|
@ -466,9 +468,7 @@ module.exports = React.createClass({
|
||||||
// here.
|
// here.
|
||||||
return !this.props.suppressFirstDateSeparator;
|
return !this.props.suppressFirstDateSeparator;
|
||||||
}
|
}
|
||||||
|
return Math.floor(prevEvent.getTs() / MILLIS_IN_DAY) !== Math.floor(nextEventTs / MILLIS_IN_DAY);
|
||||||
return (new Date(prevEvent.getTs()).toDateString()
|
|
||||||
!== new Date(nextEventTs).toDateString());
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// get a list of read receipts that should be shown next to this event
|
// get a list of read receipts that should be shown next to this event
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue