From 32736821554ceab31cdc401bc1b63e88b9335a11 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 1 Jun 2021 21:08:07 +0530 Subject: [PATCH] Do not show room id instead of canonical alias Signed-off-by: RMidhunSuresh --- src/domain/session/rightpanel/RoomInfoViewModel.js | 6 +++++- src/platform/web/ui/session/rightpanel/RoomInfoView.js | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/domain/session/rightpanel/RoomInfoViewModel.js b/src/domain/session/rightpanel/RoomInfoViewModel.js index dd74e110..7170a803 100644 --- a/src/domain/session/rightpanel/RoomInfoViewModel.js +++ b/src/domain/session/rightpanel/RoomInfoViewModel.js @@ -9,7 +9,11 @@ export class RoomInfoViewModel extends ViewModel { } get roomId() { - return this._roomSummary.canonicalAlias || this._room.id; + return this._room.id; + } + + get canonicalAlias() { + return this._roomSummary.canonicalAlias; } get name() { diff --git a/src/platform/web/ui/session/rightpanel/RoomInfoView.js b/src/platform/web/ui/session/rightpanel/RoomInfoView.js index 27d97693..c54cc978 100644 --- a/src/platform/web/ui/session/rightpanel/RoomInfoView.js +++ b/src/platform/web/ui/session/rightpanel/RoomInfoView.js @@ -12,7 +12,7 @@ export class RoomInfoView extends TemplateView { t.div({ className: "RoomAvatar" }, [t.view(new AvatarView(vm, 52)), this._createEncryptionIcon(vm.isEncrypted)]), t.div({ className: "RoomName" }, [t.h2(vm.name)]), - t.div({ className: "RoomId" }, [text(vm.roomId)]), + this._createRoomAliasDisplay(vm), t.div({ className: "SidebarRow_collection" }, [ this._createSideBarRow("People", vm.memberCount, { MemberCount: true }), @@ -21,6 +21,11 @@ export class RoomInfoView extends TemplateView { ]); } + _createRoomAliasDisplay(vm) { + return vm.canonicalAlias ? tag.div({ className: "RoomId" }, [text(vm.canonicalAlias)]) : + ""; + } + _createSideBarRow(label, value, labelClass, valueClass) { const labelClassString = classNames({ SidebarLabel: true, ...labelClass }); const valueClassString = classNames({ SidebarValue: true, ...valueClass });