From 7584e1abfd5302ad9f8adf8ba817a3366f1943be Mon Sep 17 00:00:00 2001 From: Manu Arora Date: Sat, 24 Aug 2024 15:15:32 +0530 Subject: [PATCH] fix: navbar glitch --- apps/web/app/(landing)/Navbar.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/web/app/(landing)/Navbar.tsx b/apps/web/app/(landing)/Navbar.tsx index 2ec3c2d7..01305abb 100644 --- a/apps/web/app/(landing)/Navbar.tsx +++ b/apps/web/app/(landing)/Navbar.tsx @@ -30,7 +30,7 @@ export const Navbar = () => { useMotionValueEvent(scrollYProgress, "change", (current) => { // Check if current is not undefined and is a number if (typeof current === "number") { - let direction = current! - scrollYProgress.getPrevious()!; + const direction = current - scrollYProgress.getPrevious()!; if (direction < 0) { setVisible(true); } else { @@ -43,17 +43,18 @@ export const Navbar = () => {