{_t(
- "When you log out, you'll lose your secure message history. To prevent " +
- "this, set up a recovery method.",
- )}
-
{_t(
- "Alternatively, advanced users can also manually export encryption keys in " +
- "Settings before logging out.", {},
- {
- a: sub => {sub},
- },
- )}
-
;
- } else {
- description =
{_t(
- "For security, logging out will delete any end-to-end " +
- "encryption keys from this browser. If you want to be able " +
- "to decrypt your conversation history from future Riot sessions, " +
- "please export your room keys for safe-keeping.",
- )}
;
+export default class LogoutDialog extends React.Component {
+ constructor() {
+ super();
+ this._onSettingsLinkClick = this._onSettingsLinkClick.bind(this);
+ this._onExportE2eKeysClicked = this._onExportE2eKeysClicked.bind(this);
+ this._onFinished = this._onFinished.bind(this);
+ this._onSetRecoveryMethodClick = this._onSetRecoveryMethodClick.bind(this);
+ this._onLogoutConfirm = this._onLogoutConfirm.bind(this);
}
- const onExportE2eKeysClicked = () => {
+ _onSettingsLinkClick() {
+ // close dialog
+ if (this.props.onFinished) {
+ this.props.onFinished();
+ }
+ }
+
+ _onExportE2eKeysClicked() {
Modal.createTrackedDialogAsync('Export E2E Keys', '',
import('../../../async-components/views/dialogs/ExportE2eKeysDialog'),
{
matrixClient: MatrixClientPeg.get(),
},
);
- };
+ }
- const onFinished = (confirmed) => {
+ _onFinished(confirmed) {
if (confirmed) {
dis.dispatch({action: 'logout'});
}
// close dialog
- if (props.onFinished) {
- props.onFinished();
+ if (this.props.onFinished) {
+ this.props.onFinished();
}
- };
+ }
- const onSetRecoveryMethodClick = () => {
+ _onSetRecoveryMethodClick() {
Modal.createTrackedDialogAsync('Key Backup', 'Key Backup',
import('../../../async-components/views/dialogs/keybackup/CreateKeyBackupDialog'),
);
// close dialog
- if (props.onFinished) {
- props.onFinished();
+ if (this.props.onFinished) {
+ this.props.onFinished();
}
- };
+ }
- const onLogoutConfirm = () => {
+ _onLogoutConfirm() {
dis.dispatch({action: 'logout'});
// close dialog
- if (props.onFinished) {
- props.onFinished();
+ if (this.props.onFinished) {
+ this.props.onFinished();
}
- };
+ }
- if (SettingsStore.isFeatureEnabled("feature_keybackup")) {
- if (!MatrixClientPeg.get().getKeyBackupEnabled()) {
- const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
- const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
- // Not quite a standard question dialog as the primary button cancels
- // the action and does something else instead, whilst non-default button
- // confirms the action.
- return (
-
- { description }
-
-
+
{_t(
+ "When you log out, you'll lose your secure message history. To prevent " +
+ "this, set up a recovery method.",
+ )}
+
{_t(
+ "Alternatively, advanced users can also manually export encryption keys in " +
+ "Settings before logging out.", {},
+ {
+ a: sub => {sub},
+ },
+ )}
+ ;
+ } else {
+ description =
{_t(
+ "For security, logging out will delete any end-to-end " +
+ "encryption keys from this browser. If you want to be able " +
+ "to decrypt your conversation history from future Riot sessions, " +
+ "please export your room keys for safe-keeping.",
+ )}
;
+ }
+
+ if (SettingsStore.isFeatureEnabled("feature_keybackup")) {
+ if (!MatrixClientPeg.get().getKeyBackupEnabled()) {
+ const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
+ const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
+ // Not quite a standard question dialog as the primary button cancels
+ // the action and does something else instead, whilst non-default button
+ // confirms the action.
+ return (
-
-
- );
+