mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
debounce motion only button
This commit is contained in:
parent
0096a6d778
commit
4f0a7d961a
@ -633,10 +633,10 @@ function ShowMotionOnlyButton({
|
|||||||
}: ShowMotionOnlyButtonProps) {
|
}: ShowMotionOnlyButtonProps) {
|
||||||
const [motionOnlyButton, setMotionOnlyButton] = useState(motionOnly);
|
const [motionOnlyButton, setMotionOnlyButton] = useState(motionOnly);
|
||||||
|
|
||||||
useEffect(
|
useEffect(() => {
|
||||||
() => setMotionOnly(motionOnlyButton),
|
const timeoutId = setTimeout(() => setMotionOnly(motionOnlyButton), 10);
|
||||||
[motionOnlyButton, setMotionOnly],
|
return () => clearTimeout(timeoutId);
|
||||||
);
|
}, [motionOnlyButton, setMotionOnly]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user