hotix for undefined data loads on map pages
This commit is contained in:
parent
7b78d7ba91
commit
46881f6656
5 changed files with 106 additions and 79 deletions
|
|
@ -241,7 +241,7 @@ export default function MapBase(props: Props) {
|
|||
homeMarkerAPI
|
||||
.listHomeMarkers(1, 0, undefined, undefined, undefined, undefined, as)
|
||||
.then(resp => {
|
||||
if (resp.data.homeMarker.length < 1) {
|
||||
if (!resp.data.homeMarker || resp.data.homeMarker.length < 1) {
|
||||
setHomePin(undefined);
|
||||
setHaveHome(false);
|
||||
setStartingView(props.currentView);
|
||||
|
|
@ -271,6 +271,7 @@ export default function MapBase(props: Props) {
|
|||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
openSnack("Could not load Home Pin");
|
||||
});
|
||||
}, [as, homeMarkerAPI, openSnack, props.ignoreHomeLoad, user]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue