mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
fix(voice): treat a Zone as retired only in Nepal
Every name ending in "Zone" was kept without a level and refused as a retired administrative identity. That is right for Nepal, which replaced its zones in 2015, but zones are current units elsewhere: Ethiopia's "Gamo Zone" was refused. The selector now keeps the verified level unless display_name places the zone in Nepal or names no country, and the client no longer reads "Zone" as a retired level when the source verified one.
This commit is contained in:
1 parent
682427ef1d
commit
451be8e3b7
4 files changed
+73
-2
No files matched your search
@@ -270,6 +270,12 @@ export function createVoiceAreas({
|
||||
const sourceAdmin = administrativeIdentity(sourceIdentity);
|
||||
const primaryAdmin = administrativeIdentity(primaryLabel);
|
||||
const requestedAdmin = administrativeIdentity(requestedLabel);
|
||||
// The server leaves a Zone without a level only where zones were retired
|
||||
// (Nepal). A verified level means a current zone, so "Zone" claims no level.
|
||||
if (sourceLevel && sourceAdmin.level === 'retired') {
|
||||
for (const admin of [sourceAdmin, primaryAdmin, requestedAdmin])
|
||||
if (admin.level === 'retired') admin.level = null;
|
||||
}
|
||||
const sourceClaimsAdministrative = Boolean(
|
||||
administrativeRequest ||
|
||||
administrativeLabel ||
|
||||
|
||||
Reference in new issue
Block a user