From 0a32874b39357933f530b7f2362eac09e005a545 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 22 Jan 2016 16:09:06 +0000 Subject: [PATCH] oops, reset truncate state on hide, not collapse --- src/components/structures/RoomSubList.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 244c7c8b..f18b149f 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -99,15 +99,18 @@ var RoomSubList = React.createClass({ // order the room list appropriately before we re-render //if (debug) console.log("received new props, list = " + newProps.list); this.sortList(newProps.list, newProps.order); - - if (newProps.collapsed) { // as good a way as any to reset the truncate state - this.setState({ truncateAt : 20 }); - } }, onClick: function(ev) { var isHidden = !this.state.hidden; this.setState({ hidden : isHidden }); + + if (isHidden) { + // as good a way as any to reset the truncate state + this.setState({ truncateAt : 20 }); + this.props.onShowMoreRooms(); + } + this.props.onHeaderClick(isHidden); },