You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-27 04:21:52 +03:00
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:
@ -432,11 +432,14 @@ export default React.createClass({
|
||||
|
||||
this._changeAvatarComponent = null;
|
||||
this._initGroupStore(this.props.groupId, true);
|
||||
|
||||
this._dispatcherRef = dis.register(this._onAction);
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
this._unmounted = true;
|
||||
this._matrixClient.removeListener("Group.myMembership", this._onGroupMyMembership);
|
||||
dis.unregister(this._dispatcherRef);
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(newProps) {
|
||||
@ -563,12 +566,22 @@ export default React.createClass({
|
||||
this._closeSettings();
|
||||
},
|
||||
|
||||
_onAction(payload) {
|
||||
switch (payload.action) {
|
||||
// NOTE: close_settings is an app-wide dispatch; as it is dispatched from MatrixChat
|
||||
case 'close_settings':
|
||||
this.setState({
|
||||
editing: false,
|
||||
profileForm: null,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
_closeSettings() {
|
||||
this.setState({
|
||||
editing: false,
|
||||
profileForm: null,
|
||||
});
|
||||
dis.dispatch({action: 'panel_disable'});
|
||||
dis.dispatch({action: 'close_settings'});
|
||||
},
|
||||
|
||||
_onNameChange: function(value) {
|
||||
|
Reference in New Issue
Block a user