diff --git a/res/css/_common.scss b/res/css/_common.scss
index e81c228430..c4cda6821e 100644
--- a/res/css/_common.scss
+++ b/res/css/_common.scss
@@ -250,6 +250,7 @@ textarea {
.mx_Dialog button.danger, .mx_Dialog input[type="submit"].danger {
background-color: $warning-color;
border: solid 1px $warning-color;
+ color: $accent-fg-color;
}
.mx_Dialog button:disabled, .mx_Dialog input[type="submit"]:disabled {
diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js
index 7959e7cb10..fb116cdffe 100644
--- a/src/components/views/dialogs/BaseDialog.js
+++ b/src/components/views/dialogs/BaseDialog.js
@@ -1,5 +1,6 @@
/*
Copyright 2017 Vector Creations Ltd
+Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -41,6 +42,13 @@ export default React.createClass({
// cancelled (from BaseDialog, this is always false).
onFinished: PropTypes.func.isRequired,
+ // Whether the dialog should have a 'close' button that will
+ // cause the dialog to be cancelled. This should only be set
+ // to true if there is nothing the app can sensibly do if the
+ // dialog is cancelled, eg. "We can't restore your session and
+ // the app cannot work".
+ hasCancel: PropTypes.bool,
+
// called when a key is pressed
onKeyDown: PropTypes.func,
@@ -59,6 +67,12 @@ export default React.createClass({
contentId: React.PropTypes.string,
},
+ getDefaultProps: function() {
+ return {
+ hasCancel: true,
+ };
+ },
+
childContextTypes: {
matrixClient: PropTypes.instanceOf(MatrixClient),
},
@@ -77,7 +91,7 @@ export default React.createClass({
if (this.props.onKeyDown) {
this.props.onKeyDown(e);
}
- if (e.keyCode === KeyCode.ESCAPE) {
+ if (this.props.hasCancel && e.keyCode === KeyCode.ESCAPE) {
e.stopPropagation();
e.preventDefault();
this.props.onFinished(false);
@@ -104,11 +118,11 @@ export default React.createClass({
// AT users can skip its presentation.
aria-describedby={this.props.contentId}
>
-
- { _t( - "Otherwise, click here to send a bug report.", - {}, - { 'a': (sub) => { sub } }, - ) } -
- ); + dialogButtons ={ _t("We encountered an error trying to restore your previous session. If " + - "you continue, you will need to log in again, and encrypted chat " + - "history will be unreadable.") }
+{ _t("We encountered an error trying to restore your previous session.") }
{ _t("If you have previously used a more recent version of Riot, your session " + "may be incompatible with this version. Close this window and return " + "to the more recent version.") }
- { bugreport } +{ _t("Clearing your browser's storage may fix the problem, but will sign you " + + "out and cause any encrypted chat history to become unreadable.") }