Sets the browser tab's title from the page's title, the site's name and the unread count. Every page calls useDocumentTitle, and WSProvider calls setTitleBadge.

Functions

f
setTitleBadge(count: number): void

Prefixes the tab's title with the unread count, as in "(3) Chat · gerbeur", or removes the prefix at 0. Past 99 it shows "99+".

f
useDocumentTitle(title: string | null | undefined): void

Sets the tab's title to title · site name for the page that calls it, since a client-side navigation leaves the server's <title> in place. A page passes null for the bare site name, and undefined while its data loads, which keeps the title the server rendered for that URL rather than flashing the site name.

Variables

v
SITE_EMOJI: string

The site's emoji, read once at startup, as the header shows it.

v
SITE_NAME: string

The site's name, read once at startup, as the header shows it.