Use persistence for live layout (#10114)

* Use persistence for live layout

* Fix typing

* Fix persistence typing

* remove type

* More type fixing
This commit is contained in:
Nicolas Mowen
2024-02-28 07:16:16 -07:00
committed by GitHub
parent 485057abc1
commit 8072ce25c6
5 changed files with 21 additions and 17 deletions

View File

@@ -5,6 +5,7 @@ import LivePlayer from "@/components/player/LivePlayer";
import { Button } from "@/components/ui/button";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { TooltipProvider } from "@/components/ui/tooltip";
import { usePersistence } from "@/hooks/use-persistence";
import { Event as FrigateEvent } from "@/types/event";
import { FrigateConfig } from "@/types/frigateConfig";
import { useCallback, useEffect, useMemo, useState } from "react";
@@ -17,7 +18,8 @@ function Live() {
// layout
const [layout, setLayout] = useState<"grid" | "list">(
const [layout, setLayout] = usePersistence<"grid" | "list">(
"live-layout",
isDesktop ? "grid" : "list"
);