From 8be173cae357931edd6d4561ce3e2241915d2648 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 27 Jun 2018 15:08:56 +0100 Subject: [PATCH 1/2] Show nicer error when receiving a consent error after sending a message --- src/components/structures/RoomStatusBar.js | 21 ++++++++++++++++++++- src/i18n/strings/en_EN.json | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomStatusBar.js b/src/components/structures/RoomStatusBar.js index 36f4719abb..e6e0fa70f0 100644 --- a/src/components/structures/RoomStatusBar.js +++ b/src/components/structures/RoomStatusBar.js @@ -308,7 +308,26 @@ module.exports = React.createClass({ }, ); } else { - if ( + let consentError = null; + for (const m of unsentMessages) { + if (m.error && m.error.errcode === 'M_CONSENT_NOT_GIVEN') { + consentError = m.error; + break; + } + } + if (consentError) { + title = _t( + "You can't send any messages until you review and agree to " + + "our terms and conditions.", + {}, + { + 'consentLink': (sub) => + + { sub } + , + }, + ); + } else if ( unsentMessages.length === 1 && unsentMessages[0].error && unsentMessages[0].error.data && diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index b18d167ea4..7717d45aa5 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1030,6 +1030,7 @@ "Scroll to bottom of page": "Scroll to bottom of page", "Message not sent due to unknown devices being present": "Message not sent due to unknown devices being present", "Show devices, send anyway or cancel.": "Show devices, send anyway or cancel.", + "You can't send any messages until you review and agree to our terms and conditions.": "You can't send any messages until you review and agree to our terms and conditions.", "%(count)s of your messages have not been sent.|other": "Some of your messages have not been sent.", "%(count)s of your messages have not been sent.|one": "Your message was not sent.", "%(count)s Resend all or cancel all now. You can also select individual messages to resend or cancel.|other": "Resend all or cancel all now. You can also select individual messages to resend or cancel.", From 66002a4c0061b7b58d1309f937b1dd9ba2064550 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 27 Jun 2018 15:19:27 +0100 Subject: [PATCH 2/2] Fix status bar element positioning --- res/css/structures/_RoomStatusBar.scss | 3 +++ src/components/structures/RoomStatusBar.js | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/res/css/structures/_RoomStatusBar.scss b/res/css/structures/_RoomStatusBar.scss index ca7431eac2..2a9cc9f6c7 100644 --- a/res/css/structures/_RoomStatusBar.scss +++ b/res/css/structures/_RoomStatusBar.scss @@ -113,6 +113,8 @@ limitations under the License. } .mx_RoomStatusBar_connectionLostBar { + display: flex; + margin-top: 19px; min-height: 58px; } @@ -132,6 +134,7 @@ limitations under the License. color: $primary-fg-color; font-size: 13px; opacity: 0.5; + padding-bottom: 20px; } .mx_RoomStatusBar_resend_link { diff --git a/src/components/structures/RoomStatusBar.js b/src/components/structures/RoomStatusBar.js index e6e0fa70f0..d1dc8d3c12 100644 --- a/src/components/structures/RoomStatusBar.js +++ b/src/components/structures/RoomStatusBar.js @@ -351,11 +351,13 @@ module.exports = React.createClass({ return
{_t("Warning")} -
- { title } -
-
- { content } +
+
+ { title } +
+
+ { content } +
; },