Skip to content

Commit

Permalink
fix: enabled 옵션 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimeodml committed Aug 13, 2023
1 parent 2ce7c01 commit cf0577e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/Home/components/Map/hooks/useFilterShops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
};
Expand All @@ -19,7 +22,7 @@ const useFilterShops = ({
lat: location?.latitude,
lng: location?.longitude,
}), {
enabled: !!(location),
enabled,
});

const isFetching = isLoading || !(location);
Expand Down

0 comments on commit cf0577e

Please sign in to comment.