From 405bd51b2a9924c8528e7f15d7c9c2d69326b664 Mon Sep 17 00:00:00 2001 From: fakerdeft Date: Mon, 27 Jul 2026 08:48:37 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=B5=9C=EC=B4=88=20=EC=A0=91=EA=B7=BC?= =?UTF-8?q?=20=EC=8B=9C=20=EC=9C=84=EC=B9=98=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=EC=9E=90=EB=8F=99=20=ED=91=9C=EC=8B=9C=20=EC=A0=9C=EA=B1=B0=20?= =?UTF-8?q?-=20=EC=A0=80=EC=9E=A5=EB=90=9C=20=EB=8F=99=EB=84=A4=EA=B0=80?= =?UTF-8?q?=20=EC=97=86=EC=96=B4=EB=8F=84=20=EC=9C=84=EC=B9=98=20=EB=AA=A8?= =?UTF-8?q?=EB=8B=AC=EC=9D=84=20=EC=9E=90=EB=8F=99=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=97=B4=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20-=20GPS=20=EA=B6=8C=ED=95=9C=20=EA=B1=B0=EB=B6=80?= =?UTF-8?q?=20=EB=B0=8F=20=EC=9C=84=EC=B9=98=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EC=8B=A4=ED=8C=A8=20=EC=8B=9C=20=EB=AA=A8=EB=8B=AC=20=EA=B0=95?= =?UTF-8?q?=EC=A0=9C=20=ED=91=9C=EC=8B=9C=20=EC=A0=9C=EA=B1=B0=20-=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=EA=B0=80=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EC=98=81=EC=97=AD=EC=9D=84=20=EC=A7=81=EC=A0=91=20=EB=88=8C?= =?UTF-8?q?=EB=A0=80=EC=9D=84=20=EB=95=8C=EB=A7=8C=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hooks/use-current-location.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/hooks/use-current-location.ts b/hooks/use-current-location.ts index 5c0605f..dde1551 100644 --- a/hooks/use-current-location.ts +++ b/hooks/use-current-location.ts @@ -16,17 +16,11 @@ export function useCurrentLocation() { const [needsManualInput, setNeedsManualInputState] = useState(false); const [detectionError, setDetectionError] = useState(""); const detectionPromiseRef = useRef | null>(null); - const manualInputDismissedRef = useRef(false); const setNeedsManualInput = useCallback((next: boolean) => { - manualInputDismissedRef.current = !next; setNeedsManualInputState(next); }, []); - const requestManualInput = useCallback(() => { - if (!location && !manualInputDismissedRef.current) setNeedsManualInputState(true); - }, [location]); - const detectLocation = useCallback((applyImmediately = false): Promise => { if (detectionPromiseRef.current) return detectionPromiseRef.current; markDetectionAttempted(); @@ -34,7 +28,6 @@ export function useCurrentLocation() { if (!navigator.geolocation) { locationLogger.warn("geolocation_unavailable", { reason: "unsupported_browser" }); setDetectionError("이 브라우저에서는 현재 위치를 사용할 수 없어요."); - requestManualInput(); return Promise.resolve(null); } setIsDetecting(true); @@ -56,7 +49,6 @@ export function useCurrentLocation() { reason: error instanceof Error ? error.name : "unknown", }); setDetectionError("위치 서버에 연결하지 못했어요. 다시 시도하거나 동네를 검색해 주세요."); - requestManualInput(); resolve(null); } finally { setIsDetecting(false); @@ -72,7 +64,6 @@ export function useCurrentLocation() { setDetectionError(error.code === error.PERMISSION_DENIED ? "위치 권한이 없어 현재 동네를 찾지 못했어요. 동네를 직접 검색해 주세요." : "현재 위치를 확인하지 못했어요. 다시 시도하거나 동네를 검색해 주세요."); - requestManualInput(); resolve(null); }, { enableHighAccuracy: true, timeout: 12_000, maximumAge: 0 }, @@ -83,7 +74,7 @@ export function useCurrentLocation() { }); detectionPromiseRef.current = trackedPromise; return trackedPromise; - }, [markDetectionAttempted, requestManualInput, setLocation]); + }, [markDetectionAttempted, setLocation]); useEffect(() => { if (hasAttemptedDetection || location) return; @@ -93,11 +84,6 @@ export function useCurrentLocation() { return () => window.clearTimeout(timeout); }, [detectLocation, hasAttemptedDetection, location]); - useEffect(() => { - if (location || !hasAttemptedDetection || isDetecting) return; - requestManualInput(); - }, [hasAttemptedDetection, isDetecting, location, requestManualInput]); - useEffect(() => { const locationId = location?.id; if (!locationId || !/^\d+$/.test(locationId) || refreshedLocationIds.has(locationId)) return;