From 31339aa11ff94f3d1fe74b800e2d635449cb75f9 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 14 Jul 2019 23:31:38 -0600 Subject: [PATCH] Don't show a reason if there's no reason for a kick/ban Fixes https://github.com/vector-im/riot-web/issues/9677 --- src/components/views/rooms/RoomPreviewBar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js index fb5bc3ae0d..ed91c5aafc 100644 --- a/src/components/views/rooms/RoomPreviewBar.js +++ b/src/components/views/rooms/RoomPreviewBar.js @@ -305,7 +305,7 @@ module.exports = React.createClass({ const {memberName, reason} = this._getKickOrBanInfo(); title = _t("You were kicked from %(roomName)s by %(memberName)s", {memberName, roomName: this._roomName()}); - subTitle = _t("Reason: %(reason)s", {reason}); + subTitle = reason ? _t("Reason: %(reason)s", {reason}) : null; if (this._joinRule() === "invite") { primaryActionLabel = _t("Forget this room"); @@ -322,7 +322,7 @@ module.exports = React.createClass({ const {memberName, reason} = this._getKickOrBanInfo(); title = _t("You were banned from %(roomName)s by %(memberName)s", {memberName, roomName: this._roomName()}); - subTitle = _t("Reason: %(reason)s", {reason}); + subTitle = reason ? _t("Reason: %(reason)s", {reason}) : null; primaryActionLabel = _t("Forget this room"); primaryActionHandler = this.props.onForgetClick; break;