Skip to content

Commit

Permalink
Hotfix: 모바일 화면에서 메뉴 버튼 누르면 선택한 선수들 사라지던 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
GINK-SS committed Jul 20, 2024
1 parent 1883132 commit d8a8fb9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/components/common/header/menu-filter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect } from 'react';
import { useEffect, useState } from 'react';
import { usePathname, useSearchParams } from 'next/navigation';
import { useRouter } from 'next-nprogress-bar';
import { useShallow } from 'zustand/react/shallow';
Expand All @@ -17,6 +17,7 @@ export default function MenuFilter() {
);
const setIsLoading = useCommonStore((state) => state.setIsLoading);
const clearBuff = useBuffStore((state) => state.clearBuff);
const [isMounted, setIsMounted] = useState(false);
const pathname = usePathname();
const searchParams = useSearchParams();
const limit = searchParams.get('limit');
Expand All @@ -30,6 +31,11 @@ export default function MenuFilter() {
};

useEffect(() => {
if (!isMounted) {
setIsMounted(true);
return;
}

setSelectedPlayer(null);
setPinnedPlayer(null);
clearLineup();
Expand Down

0 comments on commit d8a8fb9

Please sign in to comment.