mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-13 06:35:24 +03:00
consistent naming
This commit is contained in:
parent
fc256b0572
commit
c63945a7d2
@ -1,14 +1,14 @@
|
||||
import { useCallback, useState } from "react";
|
||||
|
||||
type useSessionStorageReturn<S> = [
|
||||
type useSessionPersistenceReturn<S> = [
|
||||
value: S | undefined,
|
||||
setValue: (value: S | undefined) => void,
|
||||
];
|
||||
|
||||
export function useSessionStorage<S>(
|
||||
export function useSessionPersistence<S>(
|
||||
key: string,
|
||||
defaultValue: S | undefined = undefined,
|
||||
): useSessionStorageReturn<S> {
|
||||
): useSessionPersistenceReturn<S> {
|
||||
const [storedValue, setStoredValue] = useState(() => {
|
||||
try {
|
||||
const value = window.sessionStorage.getItem(key);
|
||||
@ -78,7 +78,7 @@ import { useNavigate } from "react-router-dom";
|
||||
import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch";
|
||||
import useSWR from "swr";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useSessionStorage } from "@/hooks/use-session-state";
|
||||
import { useSessionPersistence } from "@/hooks/use-session-persistence";
|
||||
|
||||
type LiveCameraViewProps = {
|
||||
config?: FrigateConfig;
|
||||
@ -195,7 +195,7 @@ export default function LiveCameraView({
|
||||
|
||||
// playback state
|
||||
|
||||
const [audio, setAudio] = useSessionStorage("liveAudio", false);
|
||||
const [audio, setAudio] = useSessionPersistence("liveAudio", false);
|
||||
const [mic, setMic] = useState(false);
|
||||
const [webRTC, setWebRTC] = useState(false);
|
||||
const [pip, setPip] = useState(false);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user