From 53947bee35324c58b464e6db96803e09c58813cf Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 28 Nov 2018 14:42:30 -0600 Subject: [PATCH 1/2] Fix empty lightbox when there is no avatarUrl Signed-off-by: Aaron Raimist --- src/components/views/avatars/RoomAvatar.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/views/avatars/RoomAvatar.js b/src/components/views/avatars/RoomAvatar.js index 7b9cb10d51..506bd87adc 100644 --- a/src/components/views/avatars/RoomAvatar.js +++ b/src/components/views/avatars/RoomAvatar.js @@ -137,6 +137,11 @@ module.exports = React.createClass({ const avatarUrl = this.props.room.getAvatarUrl( MatrixClientPeg.get().getHomeserverUrl(), null, null, null, false); + + if (!avatarUrl) { + return; + } + const ImageView = sdk.getComponent("elements.ImageView"); const params = { src: avatarUrl, From 52ebba9d3eae2c7ca4a800b24846088c6853d422 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Tue, 29 Jan 2019 16:05:38 -0600 Subject: [PATCH 2/2] Disable clicking on room icon in a better way Signed-off-by: Aaron Raimist --- src/components/views/avatars/RoomAvatar.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/views/avatars/RoomAvatar.js b/src/components/views/avatars/RoomAvatar.js index 506bd87adc..38f088238f 100644 --- a/src/components/views/avatars/RoomAvatar.js +++ b/src/components/views/avatars/RoomAvatar.js @@ -137,11 +137,6 @@ module.exports = React.createClass({ const avatarUrl = this.props.room.getAvatarUrl( MatrixClientPeg.get().getHomeserverUrl(), null, null, null, false); - - if (!avatarUrl) { - return; - } - const ImageView = sdk.getComponent("elements.ImageView"); const params = { src: avatarUrl, @@ -163,7 +158,8 @@ module.exports = React.createClass({ + onClick={this.props.viewAvatarOnClick ? this.onRoomAvatarClick : null} + disabled={!this.state.urls[0]} /> ); }, });