This commit is contained in:
Mikan
2026-06-21 02:41:48 +03:00
parent c21a13d2a3
commit bd85e186dc
31 changed files with 1372 additions and 319 deletions

View File

@@ -8,6 +8,7 @@ import {
} from "react-router-dom";
import { useTranslation } from "react-i18next";
import { useAuthStore } from "@/stores/authStore";
import { useUiSettingsStore } from "@/stores/uiSettingsStore";
import { Navbar } from "@/components/ui/Navbar";
import { ToastViewport } from "@/components/ui/Toast";
import { ProtectedRoute } from "@/components/auth/ProtectedRoute";
@@ -58,9 +59,18 @@ function ScrollToTop() {
export default function App() {
const { t } = useTranslation();
const uiSettings = useUiSettingsStore((s) => s.settings);
// On mount, fetch public UI settings (page title, favicon, logo).
const fetchUiSettings = useUiSettingsStore((s) => s.fetch);
useEffect(() => {
document.title = t("common.app_name");
}, [t]);
void fetchUiSettings();
}, [fetchUiSettings]);
// Keep document.title in sync with public settings (or default to app name).
useEffect(() => {
if (uiSettings?.page_title) document.title = uiSettings.page_title;
else document.title = t("common.app_name");
}, [uiSettings?.page_title, t]);
return (
<BrowserRouter>