mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
web/main: add room name to page title
This commit is contained in:
parent
b1c02a3b69
commit
3b05d14fbd
1 changed files with 5 additions and 0 deletions
|
@ -112,6 +112,11 @@ class ContextFields implements MainScreenContextFields {
|
|||
if (pushState) {
|
||||
history.pushState({ room_id: roomID }, "")
|
||||
}
|
||||
let roomNameForTitle = room?.meta.current.name
|
||||
if (roomNameForTitle && roomNameForTitle.length > 48) {
|
||||
roomNameForTitle = roomNameForTitle.slice(0, 45) + "…"
|
||||
}
|
||||
document.title = roomNameForTitle ? `${roomNameForTitle} - gomuks web` : "gomuks web"
|
||||
}
|
||||
|
||||
clickRoom = (evt: React.MouseEvent) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue