From 8a2dabe97b77546a9b6f85fe1dfe6de5fc74c57b Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Thu, 10 Nov 2022 00:29:44 -0600 Subject: [PATCH] Fix room image avatars not showing in the room directory (#133) Fix room image avatars not showing in the room directory Fix https://github.com/matrix-org/matrix-public-archive/issues/95 --- shared/viewmodels/ArchiveRoomViewModel.js | 4 ++-- shared/views/RoomCardView.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shared/viewmodels/ArchiveRoomViewModel.js b/shared/viewmodels/ArchiveRoomViewModel.js index 1cc6460..7499261 100644 --- a/shared/viewmodels/ArchiveRoomViewModel.js +++ b/shared/viewmodels/ArchiveRoomViewModel.js @@ -104,9 +104,9 @@ class ArchiveRoomViewModel extends ViewModel { avatarTitle: this._room.name || this._room.canonicalAlias || this._room.id, avatarLetterString: this._room.name || - // Strip the `#` off the alias + // Skip to the first letter after the `#` sigil from the alias this._room.canonicalAlias?.[1] || - // Strip the `!` off the room_id + // Skip to the first letter after the `!` sigil from the room ID this._room.id?.[1], entityId: this._room.id, }); diff --git a/shared/views/RoomCardView.js b/shared/views/RoomCardView.js index 3bba34c..94974ec 100644 --- a/shared/views/RoomCardView.js +++ b/shared/views/RoomCardView.js @@ -7,13 +7,13 @@ class RoomCardView extends TemplateView { render(t, vm) { const avatarViewModel = new AvatarViewModel({ homeserverUrlToPullMediaFrom: vm.homeserverUrlToPullMediaFrom, - avatarUrl: vm.avatarUrl, + avatarUrl: vm.mxcAvatarUrl, avatarTitle: vm.name || vm.canonicalAlias || vm.roomId, avatarLetterString: vm.name || - // Strip the `#` off the alias + // Skip to the first letter after the `#` sigil from the alias vm.canonicalAlias?.[1] || - // Strip the `!` off the room_id + // Skip to the first letter after the `!` sigil from the room ID vm.roomId?.[1], entityId: vm.roomId, });