From 5d46efc3e82a33d02158a7da66fbba5a2f3eb4d0 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 30 Apr 2018 14:17:21 +0100 Subject: [PATCH 1/4] Get docs right on hasCancel --- src/components/views/dialogs/BaseDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js index 2f2d6fe8cb..71a5da224c 100644 --- a/src/components/views/dialogs/BaseDialog.js +++ b/src/components/views/dialogs/BaseDialog.js @@ -44,9 +44,9 @@ export default React.createClass({ // 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 + // to false 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". + // the app cannot work". Default: true. hasCancel: PropTypes.bool, // called when a key is pressed From 54cccab0c78de06eb89cfb23a711d266390af115 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 30 Apr 2018 14:22:18 +0100 Subject: [PATCH 2/4] Factor out clearStorageButton --- .../views/dialogs/SessionRestoreErrorDialog.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js index 779e54cfba..808c12712f 100644 --- a/src/components/views/dialogs/SessionRestoreErrorDialog.js +++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js @@ -58,6 +58,12 @@ export default React.createClass({ const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); + const clearStorageButton = ( + + ); + let dialogButtons; if (SdkConfig.get().bug_report_endpoint_url) { dialogButtons = - + {clearStorageButton} ; } else { dialogButtons = - + {clearStorageButton} ; } From c3420c37fd5ab748394f6fe55c4a368b586b9a8a Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 30 Apr 2018 14:25:42 +0100 Subject: [PATCH 3/4] Indentation --- .../views/dialogs/SessionRestoreErrorDialog.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js index 808c12712f..bc90788a28 100644 --- a/src/components/views/dialogs/SessionRestoreErrorDialog.js +++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js @@ -92,12 +92,16 @@ export default React.createClass({

{ _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.") }

+

{ _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." + ) }

-

{ _t("Clearing your browser's storage may fix the problem, but will sign you " + - "out and cause any encrypted chat history to become unreadable.") }

+

{ _t( + "Clearing your browser's storage may fix the problem, but will sign you " + + "out and cause any encrypted chat history to become unreadable." + ) }

{ dialogButtons } From e28a927da9ce8b8d8eb75d1a830886b56583d8bf Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 30 Apr 2018 14:34:14 +0100 Subject: [PATCH 4/4] lint --- src/components/views/dialogs/SessionRestoreErrorDialog.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js index bc90788a28..60430b995e 100644 --- a/src/components/views/dialogs/SessionRestoreErrorDialog.js +++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js @@ -71,7 +71,7 @@ export default React.createClass({ focus={true} hasCancel={false} > - {clearStorageButton} + { clearStorageButton } ; } else { dialogButtons = - {clearStorageButton} + { clearStorageButton } ; } @@ -95,12 +95,12 @@ export default React.createClass({

{ _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." + "to the more recent version.", ) }

{ _t( "Clearing your browser's storage may fix the problem, but will sign you " + - "out and cause any encrypted chat history to become unreadable." + "out and cause any encrypted chat history to become unreadable.", ) }

{ dialogButtons }