mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 12:43:11 +10:00
Fix google lib check for server rendering
This commit is contained in:
parent
22b71d3f27
commit
fa7c813b39
2 changed files with 2 additions and 2 deletions
|
|
@ -81,7 +81,7 @@ export class Map extends Component {
|
|||
const location = coordinatesConfig.fuzzy ? obfuscatedCenter : center;
|
||||
const centerLocationForGoogleMap = { lat: location.lat, lng: location.lng };
|
||||
|
||||
const isMapsLibLoaded = window.google && window.google.maps;
|
||||
const isMapsLibLoaded = typeof window !== 'undefined' && window.google && window.google.maps;
|
||||
|
||||
return isMapsLibLoaded ? (
|
||||
<MapWithGoogleMap
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ export class SearchMapComponent extends Component {
|
|||
? withCoordinatesObfuscated(listingsWithLocation)
|
||||
: listingsWithLocation;
|
||||
|
||||
const isMapsLibLoaded = window.google && window.google.maps;
|
||||
const isMapsLibLoaded = typeof window !== 'undefined' && window.google && window.google.maps;
|
||||
|
||||
// container element listens clicks so that opened SearchMapInfoCard can be closed
|
||||
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue