diff --git a/web/src/App.tsx b/web/src/App.tsx
index 21babc2b9..01c415de4 100644
--- a/web/src/App.tsx
+++ b/web/src/App.tsx
@@ -11,7 +11,6 @@ import { Redirect } from "./components/navigation/Redirect";
import { cn } from "./lib/utils";
import { isPWA } from "./utils/isPWA";
import ProtectedRoute from "@/components/auth/ProtectedRoute";
-import { AuthProvider } from "@/context/auth-context";
import useSWR from "swr";
import { FrigateConfig } from "./types/frigateConfig";
import ActivityIndicator from "@/components/indicators/activity-indicator";
@@ -39,13 +38,11 @@ function App() {
return (
-
-
-
- {config?.safe_mode ? : }
-
-
-
+
+
+ {config?.safe_mode ? : }
+
+
);
}
@@ -85,17 +82,13 @@ function DefaultAppView() {
: "bottom-8 left-[52px]",
)}
>
-
+
+ }
+ >
-
- ) : (
-
- )
- }
- >
+ }>
} />
} />
} />
diff --git a/web/src/components/auth/ProtectedRoute.tsx b/web/src/components/auth/ProtectedRoute.tsx
index a7d1b3596..bcfa8fdf3 100644
--- a/web/src/components/auth/ProtectedRoute.tsx
+++ b/web/src/components/auth/ProtectedRoute.tsx
@@ -10,7 +10,7 @@ import {
export default function ProtectedRoute({
requiredRoles,
}: {
- requiredRoles: string[];
+ requiredRoles?: string[];
}) {
const { auth } = useContext(AuthContext);
@@ -36,6 +36,13 @@ export default function ProtectedRoute({
);
}
+ // Wait for config to provide required roles
+ if (!requiredRoles) {
+ return (
+
+ );
+ }
+
if (auth.isLoading) {
return (
diff --git a/web/src/components/overlay/ActionsDropdown.tsx b/web/src/components/overlay/ActionsDropdown.tsx
index d73ae71e3..9ddb0bd35 100644
--- a/web/src/components/overlay/ActionsDropdown.tsx
+++ b/web/src/components/overlay/ActionsDropdown.tsx
@@ -20,7 +20,7 @@ export default function ActionsDropdown({
const { t } = useTranslation(["components/dialog", "views/replay", "common"]);
return (
-
+