fix: 4 audit findings in professionals location flow
- Clear button (✕) now resets _cityMismatch and _detectedCity so banner and CTA unblock - _citiesMatch: replace bidirectional contains with equality + word-prefix check to prevent 'Cali' matching 'Calima' - ProfessionalsProvider: track _currentUserId to reset state on user change (cross-user leak) - ProfessionalsProvider: store _lastSearch so setLocationContext preserves active search term Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
f26b3d3c03
commit
54f9cc272e
@@ -178,7 +178,8 @@ class _DashboardViewState extends State<DashboardView> {
|
||||
.replaceAll(RegExp(r'[úù]'), 'u');
|
||||
final na = normalize(a);
|
||||
final nb = normalize(b);
|
||||
return na.contains(nb) || nb.contains(na);
|
||||
// Exact match, or one is a full-word prefix of the other (handles "Bogotá D.C." vs "Bogotá")
|
||||
return na == nb || na.startsWith('$nb ') || nb.startsWith('$na ');
|
||||
}
|
||||
|
||||
Future<void> _geocodeAndMoveMap(String address) async {
|
||||
@@ -440,6 +441,8 @@ class _DashboardViewState extends State<DashboardView> {
|
||||
setState(() {
|
||||
_suggestions = [];
|
||||
_currentAddress = '';
|
||||
_detectedCity = '';
|
||||
_cityMismatch = false;
|
||||
});
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user