Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

fix(geo): check for undefined in isEqual #2643

Merged
merged 1 commit into from
Jul 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/react-instantsearch-dom-maps/src/Connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ function isEqualPosition(a, b) {
if (a === b) {
return true;
}
if (a === undefined || b === undefined) {
return false;
}

return a.lat === b.lat && a.lng === b.lng;
}

function isEqualCurrentRefinement(a, b) {
if (a === b) {
return true;
}

if (a === undefined || b === undefined) {
return false;
}

return (
isEqualPosition(a.northEast, b.northEast) &&
isEqualPosition(a.southWest, b.southWest)
Expand Down