Prefix dynamic page titles with Stalwart |

This commit is contained in:
Steven RYDELL
2026-07-30 12:14:17 +02:00
parent b1849230dc
commit e4223d8cb4
+2 -2
View File
@@ -6,12 +6,12 @@
import { useEffect } from 'react'; import { useEffect } from 'react';
const APP_NAME = 'Stalwart WebUI'; const APP_NAME = 'Stalwart';
// Keeps the tab title in sync with the current page instead of the static // Keeps the tab title in sync with the current page instead of the static
// index.html title; falls back to the bare app name when no page title is given. // index.html title; falls back to the bare app name when no page title is given.
export function useDocumentTitle(title?: string | null) { export function useDocumentTitle(title?: string | null) {
useEffect(() => { useEffect(() => {
document.title = title ? `${title} · ${APP_NAME}` : APP_NAME; document.title = title ? `${APP_NAME} | ${title}` : APP_NAME;
}, [title]); }, [title]);
} }