File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
apps/src/components/map-layers Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ const LowSkillLayer = ({
3636 timeValue = buildSkillLayerTime ( climateVariable , releaseDate ) ;
3737 }
3838
39+ const hasLayerData = layerName && timeValue ;
40+ const shouldHideLayer = ! isForecast || isLowSkillMasked ;
41+
3942 // Update the opacity on the *existing* layer if it exists. We do it like
4043 // that because we don't want a change in opacity to recreate the layer.
4144 // Instead, we want to update the existing layer (else it creates flashing
@@ -52,12 +55,7 @@ const LowSkillLayer = ({
5255 // attributes change.
5356 return useMemo (
5457 ( ) => {
55- if (
56- ! isForecast
57- || isLowSkillMasked
58- || ! layerName
59- || ! timeValue
60- ) {
58+ if ( shouldHideLayer || ! hasLayerData ) {
6159 return null ;
6260 }
6361
@@ -87,10 +85,9 @@ const LowSkillLayer = ({
8785 //
8886 // eslint-disable-next-line react-hooks/exhaustive-deps
8987 [
90- isForecast ,
91- isLowSkillMasked ,
9288 layerName ,
9389 pane ,
90+ shouldHideLayer ,
9491 timeValue ,
9592 ]
9693 ) ;
You can’t perform that action at this time.
0 commit comments