Fix face library menu item (#17155)

This commit is contained in:
Nicolas Mowen 2025-03-14 13:39:48 -06:00 committed by GitHub
parent 5d524e8060
commit 19342c8768
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -56,6 +56,7 @@ import { useIsAdmin } from "@/hooks/use-is-admin";
import SetPasswordDialog from "../overlay/SetPasswordDialog";
import { toast } from "sonner";
import axios from "axios";
import { FrigateConfig } from "@/types/frigateConfig";
type GeneralSettingsProps = {
className?: string;
@ -63,7 +64,7 @@ type GeneralSettingsProps = {
export default function GeneralSettings({ className }: GeneralSettingsProps) {
const { data: profile } = useSWR("profile");
const { data: config } = useSWR("config");
const { data: config } = useSWR<FrigateConfig>("config");
const logoutUrl = config?.proxy?.logout_url || "/api/logout";
const { theme, colorScheme, setTheme, setColorScheme } = useTheme();
@ -255,7 +256,7 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
</Link>
</>
)}
{isAdmin && isMobile && (
{isAdmin && isMobile && config?.face_recognition.enabled && (
<>
<Link to="/faces">
<MenuItem
@ -263,7 +264,7 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
aria-label="Face Library"
>
<LuSquarePen className="mr-2 size-4" />
<span>Configuration editor</span>
<span>Face Library</span>
</MenuItem>
</Link>
</>

View File

@ -435,6 +435,10 @@ export interface FrigateConfig {
enabled: boolean;
};
proxy: {
logout_url?: string;
};
record: {
enabled: boolean;
enabled_in_config: boolean | null;