refactor: update agent location display logic to prioritize state over city across UI and models
This commit is contained in:
@@ -96,10 +96,10 @@ class AgentProfile {
|
||||
}
|
||||
|
||||
String get location {
|
||||
// Direct fields first
|
||||
if (city != null && state != null) return '$city, $state';
|
||||
if (city != null) return city!;
|
||||
// Direct fields first (state first, then city)
|
||||
if (city != null && state != null) return '$state, $city';
|
||||
if (state != null) return state!;
|
||||
if (city != null) return city!;
|
||||
|
||||
// Fallback: extract from fieldValues (matches web getLocationString)
|
||||
String? fvCity;
|
||||
@@ -112,7 +112,7 @@ class AgentProfile {
|
||||
fvState = _extractFieldString(fv);
|
||||
}
|
||||
}
|
||||
final parts = [fvCity, fvState].where((s) => s != null && s.isNotEmpty);
|
||||
final parts = [fvState, fvCity].where((s) => s != null && s.isNotEmpty);
|
||||
if (parts.isNotEmpty) return parts.join(', ');
|
||||
|
||||
if (country != null && country!.isNotEmpty) return country!;
|
||||
|
||||
Reference in New Issue
Block a user