From bc8fceaf47d5152506137fb6827ebcd79dbf5654 Mon Sep 17 00:00:00 2001 From: mortezaei Date: Sat, 22 Aug 2026 03:56:02 +0330 Subject: [PATCH] fix(birthplace): update question birthplace --- .../Componentes/question-birthplace.tsx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/components/Componentes/question-birthplace.tsx b/src/components/Componentes/question-birthplace.tsx index 692af23..2593dd6 100644 --- a/src/components/Componentes/question-birthplace.tsx +++ b/src/components/Componentes/question-birthplace.tsx @@ -147,8 +147,6 @@ export function QuestionBirthplace({ if (typeof window !== "undefined") { const stored = localStorage.getItem(`residence_mode_${question.id}`); if (stored === "manual" || stored === "auto") return stored; - const legacyChecked = localStorage.getItem("hasCheckedGeoIPResidence"); - if (legacyChecked === "true") return "manual"; } return "auto"; }); @@ -280,15 +278,12 @@ export function QuestionBirthplace({ const storedMode = typeof window !== "undefined" - ? localStorage.getItem(`residence_mode_${question.id}`) || - (localStorage.getItem("hasCheckedGeoIPResidence") === "true" - ? "manual" - : null) + ? localStorage.getItem(`residence_mode_${question.id}`) : null; if (storedMode === "manual") { setMode("manual"); - } else if (storedMode === "auto") { + } else { setMode("auto"); } return; @@ -342,10 +337,7 @@ export function QuestionBirthplace({ hasAutoDetectedRef.current = true; const storedMode = typeof window !== "undefined" - ? localStorage.getItem(`residence_mode_${question.id}`) || - (localStorage.getItem("hasCheckedGeoIPResidence") === "true" - ? "manual" - : null) + ? localStorage.getItem(`residence_mode_${question.id}`) : null; if (storedMode === "manual") { @@ -355,7 +347,7 @@ export function QuestionBirthplace({ const parsed = parseValue(rawValue); if (!parsed.country && !parsed.city) { - void detectLocation(); + void detectLocation(false); } else { void detectLocation(false); } @@ -373,7 +365,6 @@ export function QuestionBirthplace({ const handleManualClick = () => { if (typeof window !== "undefined") { localStorage.setItem(`residence_mode_${question.id}`, "manual"); - localStorage.setItem("hasCheckedGeoIPResidence", "true"); } setMode("manual"); const parsed = parseValue(rawValue); @@ -438,7 +429,6 @@ export function QuestionBirthplace({ const handleSelectCountry = (country: string) => { if (typeof window !== "undefined") { localStorage.setItem(`residence_mode_${question.id}`, "manual"); - localStorage.setItem("hasCheckedGeoIPResidence", "true"); } setSelectedCountry(country); selectedCountryStateRef.current = country; @@ -453,7 +443,6 @@ export function QuestionBirthplace({ const handleCityChange = (e: React.ChangeEvent) => { if (typeof window !== "undefined") { localStorage.setItem(`residence_mode_${question.id}`, "manual"); - localStorage.setItem("hasCheckedGeoIPResidence", "true"); } const newCity = e.target.value; cityInputStateRef.current = newCity;