fix tombstone replacement room open back to previous room

This commit is contained in:
Ajay Bura 2024-07-30 16:58:49 +05:30
parent 74dc76e22e
commit 1a98b434bc

View file

@ -42,7 +42,13 @@ export const parseMatrixToUrl = (url: string): [string | undefined, string | und
};
export const getCanonicalAliasRoomId = (mx: MatrixClient, alias: string): string | undefined =>
mx.getRooms()?.find((room) => room.getCanonicalAlias() === alias)?.roomId;
mx
.getRooms()
?.find(
(room) =>
room.getCanonicalAlias() === alias &&
getStateEvent(room, StateEvent.RoomTombstone) === undefined
)?.roomId;
export const getCanonicalAliasOrRoomId = (mx: MatrixClient, roomId: string): string => {
const room = mx.getRoom(roomId);