diff --git a/src/Logic/Search/ThemeSearch.ts b/src/Logic/Search/ThemeSearch.ts index b1b6585b2c..9bf6bf8277 100644 --- a/src/Logic/Search/ThemeSearch.ts +++ b/src/Logic/Search/ThemeSearch.ts @@ -16,7 +16,7 @@ export class ThemeSearchIndex { private readonly layerIndex: Fuse<{ id: string, description }> constructor(language: string, themesToSearch?: MinimalThemeInformation[], layersToIgnore: string[] = []) { - const themes = themesToSearch ?? ThemeSearch.officialThemes?.themes + const themes = Utils.NoNull(themesToSearch ?? ThemeSearch.officialThemes?.themes) if (!themes) { throw "No themes loaded. Did generate:layeroverview fail?" } @@ -31,7 +31,7 @@ export class ThemeSearchIndex { ] } - this.themeIndex = new Fuse(themes.filter(th => th.id !== "personal"), fuseOptions) + this.themeIndex = new Fuse(themes.filter(th => th?.id !== "personal"), fuseOptions) const toIgnore = new Set(layersToIgnore) const layersAsList: { id: string, description: Record }[] = [] diff --git a/src/Logic/State/LayerState.ts b/src/Logic/State/LayerState.ts index c1e9578ce6..88bb507836 100644 --- a/src/Logic/State/LayerState.ts +++ b/src/Logic/State/LayerState.ts @@ -8,7 +8,6 @@ import Translations from "../../UI/i18n/Translations" import { RegexTag } from "../Tags/RegexTag" import { Or } from "../Tags/Or" import FilterConfig from "../../Models/ThemeConfig/FilterConfig" -import Constants from "../../Models/Constants" export type ActiveFilter = { layer: LayerConfig diff --git a/src/Models/ThemeViewState/WithSelectedElementState.ts b/src/Models/ThemeViewState/WithSelectedElementState.ts index 6f00dc570d..bb30f0d54b 100644 --- a/src/Models/ThemeViewState/WithSelectedElementState.ts +++ b/src/Models/ThemeViewState/WithSelectedElementState.ts @@ -45,7 +45,7 @@ export class WithSelectedElementState extends UserMapFeatureswitchState { selected?.properties?.name, selected?.properties?.alt_name, selected?.properties?.local_name, - layer?.title.GetRenderValue(selected?.properties ?? {}).txt, + layer?.title?.GetRenderValue(selected?.properties ?? {})?.txt, selected.properties.display_name, selected.properties.id, ] diff --git a/src/UI/SpecialVisualisations/UISpecialVisualisations.ts b/src/UI/SpecialVisualisations/UISpecialVisualisations.ts index 598ceac70f..55ab2a23c4 100644 --- a/src/UI/SpecialVisualisations/UISpecialVisualisations.ts +++ b/src/UI/SpecialVisualisations/UISpecialVisualisations.ts @@ -29,7 +29,7 @@ class QuestionViz implements SpecialVisualizationSvelte { }, { name: "blacklisted-labels", - doc: "One or more ';'-separated labels of questions which should _not_ be included", + doc: "One or more ';'-separated labels of questions which should _not_ be included. Default: 'hidden'" }, ] svelteBased = true @@ -46,10 +46,13 @@ class QuestionViz implements SpecialVisualizationSvelte { ?.split(";") ?.map((s) => s.trim()) ?.filter((s) => s !== "") - const blacklist = args[1] + const blacklist = (args[1]) ?.split(";") ?.map((s) => s.trim()) ?.filter((s) => s !== "") + if (blacklist.length === 0) { + blacklist.push("hidden") + } return new SvelteUIElement(Questionbox, { layer, tags,