1
0
Fork 0
forked from Mirrors/gomuks

web/main: add room name to page title

This commit is contained in:
Tulir Asokan 2024-12-06 14:43:53 +02:00
parent b1c02a3b69
commit 3b05d14fbd

View file

@ -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) => {