Skip to content

Commit f5be223

Browse files
authored
Merge pull request #3683 from Vizzuality/fix/tsc-tooltip-showing-perm-drivers
Fix/only show perm separator statement when present
2 parents 89dab8f + b71c543 commit f5be223

File tree

1 file changed

+6
-4
lines changed
  • app/javascript/components/widgets/widgets/forest-change/tree-loss-tsc

1 file changed

+6
-4
lines changed

app/javascript/components/widgets/widgets/forest-change/tree-loss-tsc/selectors.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,12 @@ export const parseConfig = createSelector(
158158
.reverse()
159159
);
160160
const insertIndex = findIndex(tooltip, { key: 'class_5' });
161-
tooltip.splice(insertIndex, 0, {
162-
key: 'break',
163-
label: 'Drivers of permanent deforestation:'
164-
});
161+
if (insertIndex > -1) {
162+
tooltip.splice(insertIndex, 0, {
163+
key: 'break',
164+
label: 'Drivers of permanent deforestation:'
165+
});
166+
}
165167
return {
166168
height: 250,
167169
xKey: 'year',

0 commit comments

Comments
 (0)