also forward actions from room dispatcher to global one

avoiding replay if the action would be forwarded back to
the same room dispatcher

also some fixing & renaming in OpenRoomsStore
This commit is contained in:
Bruno Windels 2018-11-22 12:23:07 +00:00
parent 2ceef00944
commit fbfbefe4fe
4 changed files with 105 additions and 72 deletions

View file

@ -50,7 +50,7 @@ export default class RoomGridView extends React.Component {
if (this._unmounted) return;
this.setState({
roomStores: OpenRoomsStore.getRoomStores(),
currentRoomStore: OpenRoomsStore.getCurrentRoomStore(),
activeRoomStore: OpenRoomsStore.getActiveRoomStore(),
});
}
@ -71,7 +71,7 @@ export default class RoomGridView extends React.Component {
return (<main className="mx_GroupGridView">
{ roomStores.map((roomStore, i) => {
if (roomStore) {
const isActive = roomStore === this.state.currentRoomStore;
const isActive = roomStore === this.state.activeRoomStore;
const tileClasses = classNames({
"mx_GroupGridView_tile": true,
"mx_GroupGridView_activeTile": isActive,

View file

@ -430,14 +430,14 @@ const LoggedInView = React.createClass({
switch (this.props.page_type) {
case PageTypes.RoomView:
if (!OpenRoomsStore.getCurrentRoomStore()) {
if (!OpenRoomsStore.getActiveRoomStore()) {
console.warn(`LoggedInView: getCurrentRoomStore not set!`);
}
else if (OpenRoomsStore.getCurrentRoomStore().getRoomId() !== this.props.currentRoomId) {
console.warn(`LoggedInView: room id in store not the same as in props: ${OpenRoomsStore.getCurrentRoomStore().getRoomId()} & ${this.props.currentRoomId}`);
else if (OpenRoomsStore.getActiveRoomStore().getRoomId() !== this.props.currentRoomId) {
console.warn(`LoggedInView: room id in store not the same as in props: ${OpenRoomsStore.getActiveRoomStore().getRoomId()} & ${this.props.currentRoomId}`);
}
page_element = <RoomView
roomViewStore={OpenRoomsStore.getCurrentRoomStore()}
roomViewStore={OpenRoomsStore.getActiveRoomStore()}
ref='roomView'
autoJoin={this.props.autoJoin}
onRegistered={this.props.onRegistered}