Fixed and improved location resolve in actor editing.
This commit is contained in:
parent
8ada96c8bc
commit
7ad424c389
|
@ -947,6 +947,10 @@ function getDeltas(edits, baseActor, options) {
|
||||||
|
|
||||||
const countryKey = key.includes('origin') ? 'originCountry' : 'residenceCountry';
|
const countryKey = key.includes('origin') ? 'originCountry' : 'residenceCountry';
|
||||||
|
|
||||||
|
if (!resolvedLocation.country) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
key: countryKey,
|
key: countryKey,
|
||||||
|
@ -957,11 +961,11 @@ function getDeltas(edits, baseActor, options) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: key.includes('origin') ? 'originState' : 'residenceState',
|
key: key.includes('origin') ? 'originState' : 'residenceState',
|
||||||
value: resolvedLocation.state,
|
value: resolvedLocation.state || null, // explicitly unset to prevent outcomes like Los Angeles, Greenland
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: key.includes('origin') ? 'originCity' : 'residenceCity',
|
key: key.includes('origin') ? 'originCity' : 'residenceCity',
|
||||||
value: resolvedLocation.city,
|
value: resolvedLocation.city || null,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue