mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
web/mainscreen: fix pushing history states when outside a space
This commit is contained in:
parent
6d1c5f6277
commit
ddf20b34d2
1 changed files with 3 additions and 3 deletions
|
@ -139,7 +139,7 @@ class ContextFields implements MainScreenContextFields {
|
||||||
room_id: roomID,
|
room_id: roomID,
|
||||||
source_via: meta?.via,
|
source_via: meta?.via,
|
||||||
source_alias: meta?.alias,
|
source_alias: meta?.alias,
|
||||||
space_id: history.state.space_id,
|
space_id: history.state?.space_id,
|
||||||
}, "")
|
}, "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ class ContextFields implements MainScreenContextFields {
|
||||||
.querySelector(`div.room-entry[data-room-id="${CSS.escape(room.roomID)}"]`)
|
.querySelector(`div.room-entry[data-room-id="${CSS.escape(room.roomID)}"]`)
|
||||||
?.scrollIntoView({ block: "nearest" })
|
?.scrollIntoView({ block: "nearest" })
|
||||||
if (pushState) {
|
if (pushState) {
|
||||||
history.pushState({ room_id: room.roomID, space_id: history.state.space_id }, "")
|
history.pushState({ room_id: room.roomID, space_id: history.state?.space_id }, "")
|
||||||
}
|
}
|
||||||
let roomNameForTitle = room.meta.current.name
|
let roomNameForTitle = room.meta.current.name
|
||||||
if (roomNameForTitle && roomNameForTitle.length > 48) {
|
if (roomNameForTitle && roomNameForTitle.length > 48) {
|
||||||
|
@ -186,7 +186,7 @@ class ContextFields implements MainScreenContextFields {
|
||||||
this.client.store.activeRoomIsPreview = false
|
this.client.store.activeRoomIsPreview = false
|
||||||
this.keybindings.activeRoom = null
|
this.keybindings.activeRoom = null
|
||||||
if (pushState) {
|
if (pushState) {
|
||||||
history.pushState({ space_id: history.state.space_id }, "")
|
history.pushState({ space_id: history.state?.space_id }, "")
|
||||||
}
|
}
|
||||||
document.title = this.#getWindowTitle()
|
document.title = this.#getWindowTitle()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue