Browse Source

Fix chat view when leaving current room

When explicitly leaving the current room through the room list view the
chat view was detached. However, as the internal state of the
Application object (which manages the placement of the chat view) was
not updated the chat view was always hidden from that point on until the
page was reloaded.

Moreover, as the chat view was detached only when explicitly leaving the
current room the chat view was not hidden for other users in the room if
it was deleted by a moderator.

As the "leaveCurrentRoom" event is triggered in the room channel when
the current room is left, either explicitly or implicitly, now the
Application object listens to that event and hides the chat view as
needed when it is received.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
pull/871/head
Daniel Calviño Sánchez 8 years ago
parent
commit
86d2d66eb0
  1. 5
      js/app.js
  2. 1
      js/views/roomlistview.js

5
js/app.js

@ -575,6 +575,11 @@
this.stopReceivingMessages();
});
this.listenTo(roomChannel, 'leaveCurrentRoom', function() {
this._chatView.$el.detach();
this._chatViewInMainView = false;
});
$(document).on('click', this.onDocumentClick);
OC.Util.History.addOnPopStateHandler(_.bind(this._onPopState, this));
},

1
js/views/roomlistview.js

@ -210,7 +210,6 @@
return;
}
OCA.SpreedMe.app._chatView.$el.detach();
OCA.SpreedMe.app.connection.leaveCurrentRoom(true);
OC.Util.History.pushState({}, OC.generateUrl('/apps/spreed'));
},

Loading…
Cancel
Save