Don't go & load the first room if we've already been told to load a different one.
This commit is contained in:
parent
36b1280f0c
commit
e0673eee29
1 changed files with 11 additions and 7 deletions
|
@ -173,14 +173,18 @@ module.exports = {
|
|||
var cli = MatrixClientPeg.get();
|
||||
var self = this;
|
||||
cli.on('syncComplete', function() {
|
||||
var firstRoom = null;
|
||||
if (cli.getRooms() && cli.getRooms().length) {
|
||||
firstRoom = RoomListSorter.mostRecentActivityFirst(
|
||||
cli.getRooms()
|
||||
)[0].roomId;
|
||||
if (!self.state.currentRoom) {
|
||||
var firstRoom = null;
|
||||
if (cli.getRooms() && cli.getRooms().length) {
|
||||
firstRoom = RoomListSorter.mostRecentActivityFirst(
|
||||
cli.getRooms()
|
||||
)[0].roomId;
|
||||
}
|
||||
self.setState({ready: true, currentRoom: firstRoom});
|
||||
self.notifyNewScreen('room/'+firstRoom);
|
||||
} else {
|
||||
self.setState({ready: true});
|
||||
}
|
||||
self.setState({ready: true, currentRoom: firstRoom});
|
||||
self.notifyNewScreen('room/'+firstRoom);
|
||||
dis.dispatch({action: 'focus_composer'});
|
||||
});
|
||||
cli.on('Call.incoming', function(call) {
|
||||
|
|
Loading…
Reference in a new issue