rebase
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user