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) {
|
||||
const [motionOnlyButton, setMotionOnlyButton] = useState(motionOnly);
|
||||
|
||||
useEffect(
|
||||
() => setMotionOnly(motionOnlyButton),
|
||||
[motionOnlyButton, setMotionOnly],
|
||||
);
|
||||
useEffect(() => {
|
||||
const timeoutId = setTimeout(() => setMotionOnly(motionOnlyButton), 10);
|
||||
return () => clearTimeout(timeoutId);
|
||||
}, [motionOnlyButton, setMotionOnly]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user