fix: double call and fav on seriesheader KO

This commit is contained in:
2025-02-17 22:25:01 +01:00
parent e9566edad9
commit 0104e04c6b
2 changed files with 20 additions and 10 deletions

View File

@@ -105,10 +105,14 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
router.push("/login");
};
const handleLinkClick = (path: string) => {
onClose();
const handleLinkClick = useCallback((path: string) => {
if (pathname === path) {
onClose();
return;
}
router.push(path);
};
onClose();
}, [pathname, router, onClose]);
const navigation = [
{