Skip to content

Commit 0a32874

Browse files
committed
oops, reset truncate state on hide, not collapse
1 parent 302c630 commit 0a32874

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎src/components/structures/RoomSubList.js‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,18 @@ var RoomSubList = React.createClass({
9999
// order the room list appropriately before we re-render
100100
//if (debug) console.log("received new props, list = " + newProps.list);
101101
this.sortList(newProps.list, newProps.order);
102-
103-
if (newProps.collapsed) { // as good a way as any to reset the truncate state
104-
this.setState({ truncateAt : 20 });
105-
}
106102
},
107103

108104
onClick: function(ev) {
109105
var isHidden = !this.state.hidden;
110106
this.setState({ hidden : isHidden });
107+
108+
if (isHidden) {
109+
// as good a way as any to reset the truncate state
110+
this.setState({ truncateAt : 20 });
111+
this.props.onShowMoreRooms();
112+
}
113+
111114
this.props.onHeaderClick(isHidden);
112115
},
113116

0 commit comments

Comments
 (0)