mirror of
https://github.com/vector-im/element-web.git
synced 2025-09-30 18:11:20 +02:00
More explicit reference checking
This commit is contained in:
parent
e92ac67152
commit
cf8c98e076
@ -130,13 +130,14 @@ export class RoomPermalinkCreator {
|
||||
}
|
||||
|
||||
forRoom() {
|
||||
try {
|
||||
if (this._room) {
|
||||
// Prefer to use canonical alias for permalink if possible
|
||||
const alias = this._room.getCanonicalAlias();
|
||||
return getPermalinkConstructor().forRoom(alias, this._serverCandidates);
|
||||
} catch (error) {
|
||||
return getPermalinkConstructor().forRoom(this._roomId, this._serverCandidates);
|
||||
if (alias) {
|
||||
return getPermalinkConstructor().forRoom(alias, this._serverCandidates);
|
||||
}
|
||||
}
|
||||
return getPermalinkConstructor().forRoom(this._roomId, this._serverCandidates);
|
||||
}
|
||||
|
||||
onRoomState(event) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user