From cf0577e24dc8541a73e1d9cc7cbbd3648d596a3e Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 22:30:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20enabled=20=EC=98=B5=EC=85=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/components/Map/hooks/useFilterShops.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/Home/components/Map/hooks/useFilterShops.ts b/src/pages/Home/components/Map/hooks/useFilterShops.ts index 9a4eafd7..8e8f46d7 100644 --- a/src/pages/Home/components/Map/hooks/useFilterShops.ts +++ b/src/pages/Home/components/Map/hooks/useFilterShops.ts @@ -2,6 +2,7 @@ import useGeolocation from 'utils/hooks/useGeolocation'; import { useQuery } from 'react-query'; import { getfilterShops } from 'api/shop'; import { FilterShopsParams } from 'api/shop/entity'; +import { useAuth } from 'store/auth'; const OPTIONS = { maximumAge: 1000, @@ -10,6 +11,8 @@ const useFilterShops = ({ options_friend, options_nearby, options_scrap, }: FilterShopsParams) => { const { location } = useGeolocation(OPTIONS); + const auth = useAuth(); + const enabled = !!(location) && !!auth; const params: FilterShopsParams = { options_friend, options_nearby, options_scrap, }; @@ -19,7 +22,7 @@ const useFilterShops = ({ lat: location?.latitude, lng: location?.longitude, }), { - enabled: !!(location), + enabled, }); const isFetching = isLoading || !(location);