diff --git a/package.json b/package.json index 429e6139..275ef4c2 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "filesize": "^3.1.2", "flux": "~2.0.3", "linkifyjs": "^2.0.0-beta.4", - "matrix-js-sdk": "^0.2.1", + "matrix-js-sdk": "^0.2.2", "matrix-react-sdk": "^0.0.1", "q": "^1.4.1", "react": "^0.13.3", diff --git a/src/skins/vector/views/molecules/MemberTile.js b/src/skins/vector/views/molecules/MemberTile.js index 991616d5..2908fdae 100644 --- a/src/skins/vector/views/molecules/MemberTile.js +++ b/src/skins/vector/views/molecules/MemberTile.js @@ -31,6 +31,23 @@ module.exports = React.createClass({ displayName: 'MemberTile', mixins: [MemberTileController], + shouldComponentUpdate: function(nextProps, nextState) { + if ( + this.member_last_modified_time === undefined || + this.member_last_modified_time < nextProps.member.getLastModifiedTime() + ) { + return true + } + if ( + nextProps.member.user && + (this.user_last_modified_time === undefined || + this.user_last_modified_time < nextProps.member.user.getLastModifiedTime()) + ) { + return true + } + return false; + }, + mouseEnter: function(e) { this.setState({ 'hover': true }); }, @@ -93,6 +110,11 @@ module.exports = React.createClass({ }, render: function() { + this.member_last_modified_time = this.props.member.getLastModifiedTime(); + if (this.props.member.user) { + this.user_last_modified_time = this.props.member.user.getLastModifiedTime(); + } + var isMyUser = MatrixClientPeg.get().credentials.userId == this.props.member.userId; var power;