actually, move signout warning to UserSettings.js
also, kill off the inexplicably useless LogoutPrompt in favour of a normal QuestionDialog. This in turn fixes https://github.com/vector-im/riot-web/issues/2152
This commit is contained in:
parent
6e55bb4956
commit
6a40abbbf0
3 changed files with 33 additions and 34 deletions
|
@ -22,7 +22,6 @@ import Notifier from './Notifier';
|
||||||
import UserActivity from './UserActivity';
|
import UserActivity from './UserActivity';
|
||||||
import Presence from './Presence';
|
import Presence from './Presence';
|
||||||
import dis from './dispatcher';
|
import dis from './dispatcher';
|
||||||
import Modal from './Modal';
|
|
||||||
import DMRoomMap from './utils/DMRoomMap';
|
import DMRoomMap from './utils/DMRoomMap';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -290,20 +289,7 @@ export function logout() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
return MatrixClientPeg.get().logout().then(onLoggedOut,
|
||||||
Modal.createDialog(QuestionDialog, {
|
|
||||||
title: "Warning",
|
|
||||||
description:
|
|
||||||
<div>
|
|
||||||
For security, logging out will delete any end-to-end encryption keys from this browser,
|
|
||||||
making previous encrypted chat history unreadable if you log back in.
|
|
||||||
In future this <a href="https://github.com/vector-im/riot-web/issues/2108">will be improved</a>,
|
|
||||||
but for now be warned.
|
|
||||||
</div>,
|
|
||||||
button: "Continue",
|
|
||||||
onFinished: (confirmed) => {
|
|
||||||
if (confirmed) {
|
|
||||||
MatrixClientPeg.get().logout().then(onLoggedOut,
|
|
||||||
(err) => {
|
(err) => {
|
||||||
// Just throwing an error here is going to be very unhelpful
|
// Just throwing an error here is going to be very unhelpful
|
||||||
// if you're trying to log out because your server's down and
|
// if you're trying to log out because your server's down and
|
||||||
|
@ -317,9 +303,6 @@ export function logout() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the matrix client and all other react-sdk services that
|
* Starts the matrix client and all other react-sdk services that
|
||||||
|
|
|
@ -79,8 +79,6 @@ import views$dialogs$ErrorDialog from './components/views/dialogs/ErrorDialog';
|
||||||
views$dialogs$ErrorDialog && (module.exports.components['views.dialogs.ErrorDialog'] = views$dialogs$ErrorDialog);
|
views$dialogs$ErrorDialog && (module.exports.components['views.dialogs.ErrorDialog'] = views$dialogs$ErrorDialog);
|
||||||
import views$dialogs$InteractiveAuthDialog from './components/views/dialogs/InteractiveAuthDialog';
|
import views$dialogs$InteractiveAuthDialog from './components/views/dialogs/InteractiveAuthDialog';
|
||||||
views$dialogs$InteractiveAuthDialog && (module.exports.components['views.dialogs.InteractiveAuthDialog'] = views$dialogs$InteractiveAuthDialog);
|
views$dialogs$InteractiveAuthDialog && (module.exports.components['views.dialogs.InteractiveAuthDialog'] = views$dialogs$InteractiveAuthDialog);
|
||||||
import views$dialogs$LogoutPrompt from './components/views/dialogs/LogoutPrompt';
|
|
||||||
views$dialogs$LogoutPrompt && (module.exports.components['views.dialogs.LogoutPrompt'] = views$dialogs$LogoutPrompt);
|
|
||||||
import views$dialogs$NeedToRegisterDialog from './components/views/dialogs/NeedToRegisterDialog';
|
import views$dialogs$NeedToRegisterDialog from './components/views/dialogs/NeedToRegisterDialog';
|
||||||
views$dialogs$NeedToRegisterDialog && (module.exports.components['views.dialogs.NeedToRegisterDialog'] = views$dialogs$NeedToRegisterDialog);
|
views$dialogs$NeedToRegisterDialog && (module.exports.components['views.dialogs.NeedToRegisterDialog'] = views$dialogs$NeedToRegisterDialog);
|
||||||
import views$dialogs$QuestionDialog from './components/views/dialogs/QuestionDialog';
|
import views$dialogs$QuestionDialog from './components/views/dialogs/QuestionDialog';
|
||||||
|
|
|
@ -228,8 +228,26 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onLogoutClicked: function(ev) {
|
onLogoutClicked: function(ev) {
|
||||||
var LogoutPrompt = sdk.getComponent('dialogs.LogoutPrompt');
|
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
this.logoutModal = Modal.createDialog(LogoutPrompt);
|
Modal.createDialog(QuestionDialog, {
|
||||||
|
title: "Sign out?",
|
||||||
|
description:
|
||||||
|
<div>
|
||||||
|
For security, logging out will delete any end-to-end encryption keys from this browser,
|
||||||
|
making previous encrypted chat history unreadable if you log back in.
|
||||||
|
In future this <a href="https://github.com/vector-im/riot-web/issues/2108">will be improved</a>,
|
||||||
|
but for now be warned.
|
||||||
|
</div>,
|
||||||
|
button: "Sign out",
|
||||||
|
onFinished: (confirmed) => {
|
||||||
|
if (confirmed) {
|
||||||
|
dis.dispatch({action: 'logout'});
|
||||||
|
if (this.props.onFinished) {
|
||||||
|
this.props.onFinished();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onPasswordChangeError: function(err) {
|
onPasswordChangeError: function(err) {
|
||||||
|
|
Loading…
Reference in a new issue