mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
Merge pull request #3212 from matrix-org/travis/close-settings
Close settings after deactivating
This commit is contained in:
commit
5daf2741a0
3 changed files with 12 additions and 3 deletions
|
@ -83,7 +83,7 @@ export default class DeactivateAccountDialog extends React.Component {
|
||||||
|
|
||||||
Analytics.trackEvent('Account', 'Deactivate Account');
|
Analytics.trackEvent('Account', 'Deactivate Account');
|
||||||
Lifecycle.onLoggedOut();
|
Lifecycle.onLoggedOut();
|
||||||
this.props.onFinished(false);
|
this.props.onFinished(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onCancel() {
|
_onCancel() {
|
||||||
|
|
|
@ -41,7 +41,7 @@ export default class UserSettingsDialog extends React.Component {
|
||||||
tabs.push(new Tab(
|
tabs.push(new Tab(
|
||||||
_td("General"),
|
_td("General"),
|
||||||
"mx_UserSettingsDialog_settingsIcon",
|
"mx_UserSettingsDialog_settingsIcon",
|
||||||
<GeneralUserSettingsTab />,
|
<GeneralUserSettingsTab closeSettingsFn={this.props.onFinished} />,
|
||||||
));
|
));
|
||||||
tabs.push(new Tab(
|
tabs.push(new Tab(
|
||||||
_td("Flair"),
|
_td("Flair"),
|
||||||
|
|
|
@ -26,12 +26,17 @@ import SettingsStore from "../../../../../settings/SettingsStore";
|
||||||
import LanguageDropdown from "../../../elements/LanguageDropdown";
|
import LanguageDropdown from "../../../elements/LanguageDropdown";
|
||||||
import AccessibleButton from "../../../elements/AccessibleButton";
|
import AccessibleButton from "../../../elements/AccessibleButton";
|
||||||
import DeactivateAccountDialog from "../../../dialogs/DeactivateAccountDialog";
|
import DeactivateAccountDialog from "../../../dialogs/DeactivateAccountDialog";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
const PlatformPeg = require("../../../../../PlatformPeg");
|
const PlatformPeg = require("../../../../../PlatformPeg");
|
||||||
const sdk = require('../../../../..');
|
const sdk = require('../../../../..');
|
||||||
const Modal = require("../../../../../Modal");
|
const Modal = require("../../../../../Modal");
|
||||||
const dis = require("../../../../../dispatcher");
|
const dis = require("../../../../../dispatcher");
|
||||||
|
|
||||||
export default class GeneralUserSettingsTab extends React.Component {
|
export default class GeneralUserSettingsTab extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
closeSettingsFn: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
@ -87,7 +92,11 @@ export default class GeneralUserSettingsTab extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
_onDeactivateClicked = () => {
|
_onDeactivateClicked = () => {
|
||||||
Modal.createTrackedDialog('Deactivate Account', '', DeactivateAccountDialog, {});
|
Modal.createTrackedDialog('Deactivate Account', '', DeactivateAccountDialog, {
|
||||||
|
onFinished: (success) => {
|
||||||
|
if (success) this.props.closeSettingsFn();
|
||||||
|
},
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_renderProfileSection() {
|
_renderProfileSection() {
|
||||||
|
|
Loading…
Reference in a new issue