Skip to content

Commit

Permalink
fix: avoid crash when opening map with unsupported Earth Engine layer (
Browse files Browse the repository at this point in the history
…#3286)

To set the data-test attribute on the LayerCard div we use replace to remove whitespace
from the title (introduced in #3021).

In some edge cases title can be undefined, and we avoid this error if we set the fallback value to ''.

The error occurs for two saved maps with old EE layers that should be
removed from from Sierra Leone demo database:
* Map: Nighttime lights (AHWtSmx21sx)
* Malaria: Cases with elevation eastern area (gJ1BHisY9Wm)

Co-authored-by: Jen Jones Arnesen <[email protected]>
  • Loading branch information
turban and jenniferarnesen authored Aug 14, 2024
1 parent 9efdff5 commit 69c3eed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/layers/LayerCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import styles from './styles/LayerCard.module.css'
import LayerToolbar from './toolbar/LayerToolbar.js'

const LayerCard = ({
title,
title = '',
subtitle,
isOverlay,
isExpanded,
Expand Down

0 comments on commit 69c3eed

Please sign in to comment.