Proxy Saving and UX Fixes (#4467)

This commit is contained in:
Marc Kelechava
2026-01-15 13:26:26 -08:00
committed by GitHub
parent 5e23c580e7
commit be3128e47d
6 changed files with 21 additions and 7 deletions

View File

@@ -149,6 +149,15 @@ export function geoTargetToProxyLocationInput(
return ProxyLocation.ResidentialISP;
}
// Guard against malformed subdivision (e.g., boolean instead of string)
if (target.subdivision != null && typeof target.subdivision !== "string") {
console.error(
"[geoTargetToProxyLocationInput] Invalid subdivision:",
target.subdivision,
);
target = { ...target, subdivision: undefined };
}
// Try to map back to legacy enum if it's just a country
if (target.country && !target.subdivision && !target.city) {
const legacyLocation = COUNTRY_TO_PROXY_LOCATION[target.country];