From 2403eca6af23caae64675c48c8e80d7324c4b5ea Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 22 Mar 2016 17:47:40 +0000 Subject: [PATCH] profoundly evil ugly hack to workaround amandine's invite focus issues on her note-to-self rooms --- src/components/structures/RoomView.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 7f4d8ea91a..3f4a666c56 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -442,7 +442,12 @@ module.exports = React.createClass({ // XXX: EVIL HACK to autofocus inviting on empty rooms. // We use the setTimeout to avoid racing with focus_composer. - if (this.state.room && this.state.room.getJoinedMembers().length == 1) { + if (this.state.room && + this.state.room.getJoinedMembers().length == 1 && + this.state.room.getLiveTimeline() && + this.state.room.getLiveTimeline().getEvents() && + this.state.room.getLiveTimeline().getEvents().length <= 6) + { var inviteBox = document.getElementById("mx_SearchableEntityList_query"); setTimeout(function() { if (inviteBox) {