diff --git a/src/Lifecycle.js b/src/Lifecycle.js
index ec1fca2bc6..793b0f956b 100644
--- a/src/Lifecycle.js
+++ b/src/Lifecycle.js
@@ -215,18 +215,16 @@ function _restoreFromLocalStorage() {
if (accessToken && userId && hsUrl) {
console.log(`Restoring session for ${userId}`);
- try {
- return _doSetLoggedIn({
- userId: userId,
- deviceId: deviceId,
- accessToken: accessToken,
- homeserverUrl: hsUrl,
- identityServerUrl: isUrl,
- guest: isGuest,
- }, false).then(() => true);
- } catch (e) {
+ return _doSetLoggedIn({
+ userId: userId,
+ deviceId: deviceId,
+ accessToken: accessToken,
+ homeserverUrl: hsUrl,
+ identityServerUrl: isUrl,
+ guest: isGuest,
+ }, false).catch((e) => {
return _handleRestoreFailure(e);
- }
+ }).then(() => true);
} else {
console.log("No previous session found.");
return Promise.resolve(false);
diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js
index 451785197e..401550043b 100644
--- a/src/components/views/dialogs/SessionRestoreErrorDialog.js
+++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js
@@ -41,10 +41,14 @@ export default React.createClass({
Modal.createTrackedDialog('Session Restore Error', 'Send Bug Report Dialog', BugReportDialog, {});
},
- _continueClicked: function() {
+ _onContinueClick: function() {
this.props.onFinished(true);
},
+ _onCancelClick: function() {
+ this.props.onFinished(false);
+ },
+
render: function() {
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
@@ -81,8 +85,8 @@ export default React.createClass({
{ bugreport }
+ onPrimaryButtonClick={this._onContinueClick} focus={shouldFocusContinueButton}
+ onCancel={this._onCancelClick} />
);
},
diff --git a/src/components/views/elements/DialogButtons.js b/src/components/views/elements/DialogButtons.js
index c159324c1d..537f906a74 100644
--- a/src/components/views/elements/DialogButtons.js
+++ b/src/components/views/elements/DialogButtons.js
@@ -39,6 +39,10 @@ module.exports = React.createClass({
focus: PropTypes.bool,
},
+ _onCancelClick: function() {
+ this.props.onCancel();
+ },
+
render: function() {
let primaryButtonClassName = "mx_Dialog_primary";
if (this.props.primaryButtonClass) {
@@ -53,7 +57,7 @@ module.exports = React.createClass({
{ this.props.primaryButton }
{ this.props.children }
-