From 86807b631d2425576c572fc93d00b8f15b04ba23 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 18 Mar 2016 19:16:55 +0000 Subject: [PATCH] don't reset RoomHeader every time the props change due to RoomView re-rendering during edits --- src/components/views/rooms/RoomHeader.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index 1e4328293a..ec72f25454 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -49,8 +49,12 @@ module.exports = React.createClass({ }; }, + getInitialState: function() { + return {}; + }, + componentWillReceiveProps: function(newProps) { - if (newProps.editing) { + if (this.props.room !== newProps.room && newProps.editing) { var topic = this.props.room.currentState.getStateEvents('m.room.topic', ''); var name = this.props.room.currentState.getStateEvents('m.room.name', '');