Skip to content

Commit

Permalink
Fix home screen member footer visibility (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-radhika-s authored Jan 6, 2025
1 parent 502bf0c commit 667f329
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/lib/ui/flow/home/map/map_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,20 @@ class MapViewNotifier extends StateNotifier<MapViewState> {
target: LatLng(0.0, 0.0), zoom: defaultCameraZoom))) {
_lastCameraPosition = state.defaultPosition;
checkUserPermission();
loadData(_currentSpaceId);
_loadData(_currentSpaceId);
}

void loadData(String? spaceId) {
void _loadData(String? spaceId) {
_resetState();
if (spaceId == null) return;
_listenMemberLocation(spaceId);
_listenPlaces(spaceId);
}

void _onUpdateUser({ApiUser? prevUser, ApiUser? currentUser}) {
_resetState();
if(currentUser == null) _resetState();
if (currentUser != null && prevUser?.id != currentUser.id) {
_resetState();
fetchCurrentUserLocation();
}
}
Expand All @@ -106,7 +107,7 @@ class MapViewNotifier extends StateNotifier<MapViewState> {
}
if (prev == current) return;
_resetState();
loadData(current);
_loadData(current);
}

void _resetState() {
Expand Down

0 comments on commit 667f329

Please sign in to comment.