Fix click on faded left/right/middle panel -> close settings

- implement generic dispatch to close user/room/group settings
 - use dispatch to allow clicks on disabled left/right/middle panel to
   close settings

A much more maintainable approach would be to use dedicate routing
instead of doing different things depending on what page of the app is
currently being viewed. At the very least we could make the concept of a
settings page generic.
This commit is contained in:
Luke Barnard 2018-05-29 13:16:39 +01:00
parent b2c26e6984
commit da9fe9917b
5 changed files with 100 additions and 48 deletions

View file

@ -44,6 +44,8 @@ const INITIAL_STATE = {
forwardingEvent: null,
quotingEvent: null,
isEditingSettings: false,
};
/**
@ -116,6 +118,16 @@ class RoomViewStore extends Store {
replyingToEvent: payload.event,
});
break;
case 'open_room_settings':
this._setState({
isEditingSettings: true,
});
break;
case 'close_settings':
this._setState({
isEditingSettings: false,
});
break;
}
}
@ -301,6 +313,10 @@ class RoomViewStore extends Store {
return this._state.replyingToEvent;
}
isEditingSettings() {
return this._state.isEditingSettings;
}
shouldPeek() {
return this._state.shouldPeek;
}