This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2955 from matrix-org/t3chguy/close_room_settings_…
…leave_room Close Room Settings upon Leave Room
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright 2019 New Vector Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -24,13 +25,30 @@ import GeneralRoomSettingsTab from "../settings/tabs/room/GeneralRoomSettingsTab | |
import SecurityRoomSettingsTab from "../settings/tabs/room/SecurityRoomSettingsTab"; | ||
import sdk from "../../../index"; | ||
import MatrixClientPeg from "../../../MatrixClientPeg"; | ||
import dis from "../../../dispatcher"; | ||
|
||
export default class RoomSettingsDialog extends React.Component { | ||
static propTypes = { | ||
roomId: PropTypes.string.isRequired, | ||
onFinished: PropTypes.func.isRequired, | ||
}; | ||
|
||
componentWillMount() { | ||
this._dispatcherRef = dis.register(this._onAction); | ||
} | ||
|
||
componentWillUnmount() { | ||
dis.unregister(this._dispatcherRef); | ||
} | ||
|
||
_onAction = (payload) => { | ||
// When room changes below us, close the room settings | ||
// whilst the modal is open this can only be triggered when someone hits Leave Room | ||
if (payload.action === 'view_next_room') { | ||
this.props.onFinished(); | ||
} | ||
}; | ||
|
||
_getTabs() { | ||
const tabs = []; | ||
|
||
|