'Back to results' handled properly
This commit is contained in:
@@ -185,6 +185,19 @@ const onListingMouseOver = ({type, action}, component) => {
|
||||
|
||||
};
|
||||
|
||||
const backToResults = ({type, action}, component) => {
|
||||
const prevSelected = component.findMarker(component.state.listingId);
|
||||
component.setState({
|
||||
listingId: undefined,
|
||||
listingDetails: false
|
||||
}, () => {
|
||||
|
||||
if (prevSelected) {
|
||||
prevSelected.marker.setIcon(component.visitedMarkerIcon());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const handlers = {
|
||||
SET_MIN_PRICE: setMinPrice,
|
||||
SET_MAX_PRICE: setMaxPrice,
|
||||
@@ -200,7 +213,8 @@ const handlers = {
|
||||
VIEW_LISTING_DETAILS: viewListingDetails,
|
||||
UPDATE_SEARCH: updateSearch,
|
||||
SET_CATEGORY: setCategory,
|
||||
ON_LISTING_MOUSE_OVER: onListingMouseOver
|
||||
ON_LISTING_MOUSE_OVER: onListingMouseOver,
|
||||
BACK_TO_RESULTS: backToResults
|
||||
};
|
||||
|
||||
export const handleMessage = ({ type, action }, component) => {
|
||||
|
||||
Reference in New Issue
Block a user