Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit e1cdd2b

Browse files
committed
Merge branch 'release/v1.0.85'
2 parents 3d2a4a9 + 0cfa45e commit e1cdd2b

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@hisptz/react-ui",
33
"homepage": "https://hisptz.github.io/react-ui",
4-
"version": "1.0.84",
4+
"version": "1.0.85",
55
"description": "A collection of reusable complex DHIS2 react ui components.",
66
"license": "BSD-3-Clause",
77
"scripts": {

src/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,16 @@ export function useGoogleEngineLayers() {
303303

304304
const sanitizeLayers = useCallback(
305305
async (layers: EarthEngineLayerConfig[]): Promise<CustomGoogleEngineLayer[]> => {
306+
if (isEmpty(layers)) {
307+
return [];
308+
}
309+
306310
try {
307311
const { token } = await refresh();
312+
if (!token) {
313+
console.error(`Google token not available in this instance`);
314+
return [];
315+
}
308316
await EarthEngine.setToken(token, refresh);
309317
return map(
310318
layers,

0 commit comments

Comments
 (0)