From 0cb60949928d7e4de141a4e08e05db7bfcb04102 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 10 Jan 2016 18:46:08 +0000 Subject: [PATCH] show implicit names as placeholders if available --- src/components/views/rooms/RoomHeader.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index 072397526b..77ab01afb1 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -44,9 +44,11 @@ module.exports = React.createClass({ componentWillReceiveProps: function(newProps) { if (newProps.editing) { var topic = this.props.room.currentState.getStateEvents('m.room.topic', ''); + var name = this.props.room.currentState.getStateEvents('m.room.name', ''); this.setState({ - name: this.props.room.name, + name: name ? name.getContent().name : '', + initialName: name ? name.getContent().name : '', topic: topic ? topic.getContent().topic : '', }); } @@ -119,12 +121,14 @@ module.exports = React.createClass({ // // if (topic) topic_el =
+ var placeholderName = this.state.initialName ? "Unnamed Room" : this.props.room.name; + name =