diff --git a/src/ui/errors/ErrorPage.tsx b/src/ui/errors/ErrorPage.tsx index 555bbcaf..4f39e668 100644 --- a/src/ui/errors/ErrorPage.tsx +++ b/src/ui/errors/ErrorPage.tsx @@ -120,9 +120,19 @@ export function ErrorPage({ code }: ErrorPageProps): JSX.Element { const support = translations?.support ?? "Поддержка"; const refresh = translations?.refresh ?? (config.refreshKey ? "Обновить страницу" : undefined); const displayCode = code ?? "?"; + const documentTitle = `${displayCode} — ${title}`; + + // React 18 doesn't hoist inside body to document.head, so set + // document.title imperatively on the client once translations resolve. + useEffect(() => { + if (typeof document !== "undefined" && translations) { + document.title = documentTitle; + } + }, [documentTitle, translations]); return ( <> + <title>{documentTitle} {/* noindex: error pages must not be indexed (TZ §4.1.21) */}