This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/components/views/dialogs Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 11/*
22Copyright 2019 New Vector Ltd
3+ Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
34
45Licensed under the Apache License, Version 2.0 (the "License");
56you may not use this file except in compliance with the License.
@@ -24,13 +25,30 @@ import GeneralRoomSettingsTab from "../settings/tabs/room/GeneralRoomSettingsTab
2425import SecurityRoomSettingsTab from "../settings/tabs/room/SecurityRoomSettingsTab" ;
2526import sdk from "../../../index" ;
2627import MatrixClientPeg from "../../../MatrixClientPeg" ;
28+ import dis from "../../../dispatcher" ;
2729
2830export default class RoomSettingsDialog extends React . Component {
2931 static propTypes = {
3032 roomId : PropTypes . string . isRequired ,
3133 onFinished : PropTypes . func . isRequired ,
3234 } ;
3335
36+ componentWillMount ( ) {
37+ this . _dispatcherRef = dis . register ( this . _onAction ) ;
38+ }
39+
40+ componentWillUnmount ( ) {
41+ dis . unregister ( this . _dispatcherRef ) ;
42+ }
43+
44+ _onAction = ( payload ) => {
45+ // When room changes below us, close the room settings
46+ // whilst the modal is open this can only be triggered when someone hits Leave Room
47+ if ( payload . action === 'view_next_room' ) {
48+ this . props . onFinished ( ) ;
49+ }
50+ } ;
51+
3452 _getTabs ( ) {
3553 const tabs = [ ] ;
3654
You can’t perform that action at this time.
0 commit comments