From 5f8a7b46a818a089d124ae67cb0a95c8302eeb46 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 6 Apr 2017 11:44:15 +0100 Subject: [PATCH] Remove redundant setState call, always focus composer after sync --- src/components/structures/MatrixChat.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 056024f24b..7fe3b1ee38 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -644,7 +644,7 @@ module.exports = React.createClass({ // Wait for the first sync to complete so that if a room does have an alias, // it would have been retrieved. let waitFor = q(null); - if (!firstSyncComplete) { + if (!this.firstSyncComplete) { if (!this.firstSyncPromise) { console.warn('Cannot view a room before first sync. room_id:', room_info.room_id); return; @@ -851,13 +851,8 @@ module.exports = React.createClass({ self.firstSyncComplete = true; self.firstSyncPromise.resolve(); - if (!self.state.page_type) { - // Switch to room view but allow _onLoggedIn to specify a room (if any) - self.setState({ready: true}); - dis.dispatch({action: 'focus_composer'}); - } else { - self.setState({ready: true}); - } + dis.dispatch({action: 'focus_composer'}); + self.setState({ready: true}); }); cli.on('Call.incoming', function(call) { dis.dispatch({