From 68759d35641766dfd979c050c9a9d57152ef8180 Mon Sep 17 00:00:00 2001 From: sunhpark42 Date: Mon, 13 Sep 2021 17:57:34 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=95=84=ED=84=B0=20=EB=B0=8F=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95=EC=9D=B4=20=EC=A0=95=EC=83=81?= =?UTF-8?q?=EB=8F=99=EC=9E=91=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 연관 이슈 - 2 > 1 페이지 이동 x - 마지막 필터 취소 시 취소되지 않음 --- frontend/src/hooks/useFilterWithParams.js | 4 ++-- frontend/src/pages/ProfilePagePosts/index.js | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/frontend/src/hooks/useFilterWithParams.js b/frontend/src/hooks/useFilterWithParams.js index c93eb4ebb..8f1723b49 100644 --- a/frontend/src/hooks/useFilterWithParams.js +++ b/frontend/src/hooks/useFilterWithParams.js @@ -43,8 +43,8 @@ const useFilterWithParams = () => { }; const getFullParams = useCallback(() => { - if (postQueryParams.page == 1) { - delete postQueryParams.page + if (postQueryParams.page === 1) { + delete postQueryParams.page; } const pageParams = queryString.stringify(postQueryParams); diff --git a/frontend/src/pages/ProfilePagePosts/index.js b/frontend/src/pages/ProfilePagePosts/index.js index 910d5d885..7c4ccf7ab 100644 --- a/frontend/src/pages/ProfilePagePosts/index.js +++ b/frontend/src/pages/ProfilePagePosts/index.js @@ -96,12 +96,8 @@ const ProfilePagePosts = () => { useEffect(() => { const params = getFullParams(); - if (!params) { - return; - } - history.push(`${PATH.ROOT}${username}/posts${params ? '?' + params : ''}`); - }, [getFullParams, postQueryParams, selectedFilterDetails, username]); + }, [postQueryParams, selectedFilterDetails, username]); useEffect(() => { if (!shouldInitialLoad) {