fix room not opening when two rooms has same alias (#2387)

This commit is contained in:
Ajay Bura 2025-07-11 16:30:30 +05:30 committed by GitHub
parent c757b8967f
commit 6b81401e2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,7 +50,11 @@ export const getCanonicalAliasOrRoomId = (mx: MatrixClient, roomId: string): str
const room = mx.getRoom(roomId);
if (!room) return roomId;
if (getStateEvent(room, StateEvent.RoomTombstone) !== undefined) return roomId;
return room.getCanonicalAlias() || roomId;
const alias = room.getCanonicalAlias();
if (alias && getCanonicalAliasRoomId(mx, alias) === roomId) {
return alias;
}
return roomId;
};
export const getImageInfo = (img: HTMLImageElement, fileOrBlob: File | Blob): IImageInfo => {