fix
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { useEffect } from "react";
|
||||
import { Routes, Route, Navigate } from "react-router-dom";
|
||||
import { useAuthStore } from "@/store/auth";
|
||||
import { useUiStore } from "@/store/ui";
|
||||
import { Navbar } from "@/components/ui/Navbar";
|
||||
import { HomePage } from "@/pages/HomePage";
|
||||
import { LoginPage } from "@/pages/LoginPage";
|
||||
@@ -26,6 +28,15 @@ function AdminRoute({ children }: { children: JSX.Element }) {
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
// Load public UI settings (logo URL, etc.) once on app boot. These are
|
||||
// unauthenticated and cached by the api layer, so subsequent navigations
|
||||
// do not re-fetch. The admin panel calls load(true) after saving to
|
||||
// pick up a new logo URL without a full page reload.
|
||||
const loadUi = useUiStore((s) => s.load);
|
||||
useEffect(() => {
|
||||
loadUi();
|
||||
}, [loadUi]);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col">
|
||||
<Navbar />
|
||||
|
||||
Reference in New Issue
Block a user