Skip to content

Commit

Permalink
Fixes map opening when user selects a new location after map has been…
Browse files Browse the repository at this point in the history
… closed
  • Loading branch information
eireland committed Feb 1, 2024
1 parent 6d40de8 commit f1235e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ export const App = () => {

const createMapListener = (listenerRes: ClientNotification) => {
const { values } = listenerRes;
if (values.operation === "delete" && values.type === "DG.MapView" && values.name === "US Weather Stations") {
if (values.operation === "delete" && values.type === "DG.MapView" && values.name === "US-Weather-Stations") {
setState((draft) => {
draft.zoomMap = false;
draft.isMapOpen = false;
draft.didUserSelectStationFromMap = false;
});
}
};
Expand Down
4 changes: 3 additions & 1 deletion src/components/location-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@ export const LocationPicker = () => {
placeNameSelected(locationPossibilities[selectedLocIdx]);
setState(draft=>{
draft.location = locationPossibilities[selectedLocIdx];
draft.zoomMap = true;
draft.didUserSelectStationFromMap = false;
if (state.isMapOpen) {
draft.zoomMap = true;
}
});
}
}
Expand Down

0 comments on commit f1235e3

Please sign in to comment.