Fix: don't show preset_type special vis if no presets are given

This commit is contained in:
Pieter Vander Vennet 2024-09-02 03:40:13 +02:00
parent dbff953096
commit cf3b4145ff

View file

@ -1996,6 +1996,9 @@ export default class SpecialVisualizations {
): BaseUIElement { ): BaseUIElement {
const translation = tagSource.map((tags) => { const translation = tagSource.map((tags) => {
const presets = state.layout.getMatchingLayer(tags)?.presets const presets = state.layout.getMatchingLayer(tags)?.presets
if(!presets){
return undefined
}
const matchingPresets = presets const matchingPresets = presets
.filter((pr) => pr.description !== undefined) .filter((pr) => pr.description !== undefined)
.filter((pr) => new And(pr.tags).matchesProperties(tags)) .filter((pr) => new And(pr.tags).matchesProperties(tags))