We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07d0019 commit 7111969Copy full SHA for 7111969
src/hooks/useNavigationOpacity.ts
@@ -19,7 +19,9 @@ export const useNavigationOpacity = ({
19
setNavOpacity('opacity-80')
20
}
21
22
- timerRef.current && clearTimeout(timerRef.current)
+ if (timerRef.current) {
23
+ clearTimeout(timerRef.current)
24
+ }
25
26
if (window.scrollY < lastScrollY) {
27
timerRef.current = setTimeout(() => {
@@ -34,7 +36,9 @@ export const useNavigationOpacity = ({
34
36
35
37
return () => {
38
window.removeEventListener('scroll', handleScroll)
39
40
41
42
43
}, [setNavOpacity, timerRef])
44
0 commit comments