Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2955 from matrix-org/t3chguy/close_room_settings_…
Browse files Browse the repository at this point in the history
…leave_room

Close Room Settings upon Leave Room
  • Loading branch information
turt2live committed May 13, 2019
2 parents 76f37d6 + 249f3d9 commit 8af6bc0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components/views/dialogs/RoomSettingsDialog.js
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.
Expand All @@ -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 = [];

Expand Down

0 comments on commit 8af6bc0

Please sign in to comment.