forked from mirror/cinny
fix tombstone replacement room open previous room (#1856)
This commit is contained in:
parent
5058136737
commit
e54bb2e423
1 changed files with 7 additions and 1 deletions
|
@ -33,7 +33,13 @@ export const isRoomId = (id: string): boolean => validMxId(id) && id.startsWith(
|
|||
export const isRoomAlias = (id: string): boolean => validMxId(id) && id.startsWith('#');
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue