hack so we don't revert to single room view when viewing grid

pull/21833/head
Bruno Windels 2018-11-22 18:57:07 +00:00
parent 0ffd77762a
commit 368ef9e8e8
1 changed files with 9 additions and 4 deletions

View File

@ -102,10 +102,15 @@ class OpenRoomsStore extends Store {
const dispatcher = new MatrixDispatcher(); const dispatcher = new MatrixDispatcher();
// forward all actions coming from the room dispatcher // forward all actions coming from the room dispatcher
// to the global one // to the global one
const dispatcherRef = dispatcher.register((action) => { const dispatcherRef = dispatcher.register((payload) => {
action.grid_src_room_id = room_id; // block a view_room action for the same room because it will switch to
action.grid_src_room_alias = room_alias; // single room mode in MatrixChat
this.getDispatcher().dispatch(action); if (payload.action === 'view_room' && room_id === payload.room_id) {
return;
}
payload.grid_src_room_id = room_id;
payload.grid_src_room_alias = room_alias;
this.getDispatcher().dispatch(payload);
}); });
const openRoom = { const openRoom = {
store: new RoomViewStore(dispatcher), store: new RoomViewStore(dispatcher),