From d6821ecb990c7667e96fab58661fbc3cb89e76bd Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 27 Nov 2019 10:44:36 -0700 Subject: [PATCH 1/3] Fix multi-invite error dialog messaging Fixes https://github.com/vector-im/riot-web/issues/11515 --- src/RoomInvite.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/RoomInvite.js b/src/RoomInvite.js index 64aab36128..babed0e6b8 100644 --- a/src/RoomInvite.js +++ b/src/RoomInvite.js @@ -202,11 +202,14 @@ function _showAnyInviteErrors(addrs, room, inviter) { } } + // React 16 doesn't let us use `errorList.join(
)` anymore, so this is our solution + let description =
{errorList.map(e =>
{e}
)}
; + if (errorList.length > 0) { const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Failed to invite the following users to the room', '', ErrorDialog, { title: _t("Failed to invite the following users to the %(roomName)s room:", {roomName: room.name}), - description: errorList.join(
), + description, }); } } From 275bd33a6c59f25106063e3967c93b942c111872 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 27 Nov 2019 10:48:05 -0700 Subject: [PATCH 2/3] Move the description into the relevant branch --- src/RoomInvite.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RoomInvite.js b/src/RoomInvite.js index babed0e6b8..c72ca4d662 100644 --- a/src/RoomInvite.js +++ b/src/RoomInvite.js @@ -202,10 +202,10 @@ function _showAnyInviteErrors(addrs, room, inviter) { } } - // React 16 doesn't let us use `errorList.join(
)` anymore, so this is our solution - let description =
{errorList.map(e =>
{e}
)}
; - if (errorList.length > 0) { + // React 16 doesn't let us use `errorList.join(
)` anymore, so this is our solution + let description =
{errorList.map(e =>
{e}
)}
; + const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Failed to invite the following users to the room', '', ErrorDialog, { title: _t("Failed to invite the following users to the %(roomName)s room:", {roomName: room.name}), From 3b5aa5e9b82a0f7d598bc457ac03c55dea1893be Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 27 Nov 2019 16:57:44 -0700 Subject: [PATCH 3/3] Update src/RoomInvite.js Co-Authored-By: Michael Telatynski <7t3chguy@gmail.com> --- src/RoomInvite.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/RoomInvite.js b/src/RoomInvite.js index c72ca4d662..b2b8689174 100644 --- a/src/RoomInvite.js +++ b/src/RoomInvite.js @@ -204,7 +204,7 @@ function _showAnyInviteErrors(addrs, room, inviter) { if (errorList.length > 0) { // React 16 doesn't let us use `errorList.join(
)` anymore, so this is our solution - let description =
{errorList.map(e =>
{e}
)}
; + const description =
{errorList.map(e =>
{e}
)}
; const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Failed to invite the following users to the room', '', ErrorDialog, { @@ -228,4 +228,3 @@ function _getDirectMessageRooms(addr) { }); return rooms; } -