From 4b121e474ce6998f03e9743e4b52e2de1288b71a Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 9 Dec 2024 16:12:20 +0100 Subject: [PATCH] Fix: improve typing and probably fix broken settings (https://source.mapcomplete.org/MapComplete/MapComplete/issues/2281) --- src/UI/Popup/DisabledQuestions.svelte | 8 +++++--- src/UI/Popup/DisabledQuestionsLayer.svelte | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/UI/Popup/DisabledQuestions.svelte b/src/UI/Popup/DisabledQuestions.svelte index 0e2d0587f..1b36a7633 100644 --- a/src/UI/Popup/DisabledQuestions.svelte +++ b/src/UI/Popup/DisabledQuestions.svelte @@ -3,15 +3,17 @@ import { Stores } from "../../Logic/UIEventSource" import Tr from "../Base/Tr.svelte" import Translations from "../i18n/Translations" + import type { SpecialVisualizationState } from "../SpecialVisualization" + import ThemeViewState from "../../Models/ThemeViewState" /** * Shows _all_ disabled questions */ - export let state - let layers = state.layout.layers.filter((l) => l.isNormal()) + export let state: ThemeViewState + let layers = state.theme.layers.filter((l) => l.isNormal()) let allDisabled = Stores.concat( - layers.map((l) => state.userRelatedState.getThemeDisabled(state.layout.id, l.id)) + layers.map((l) => state.userRelatedState.getThemeDisabled(state.theme.id, l.id)) ).map((l) => [].concat(...l)) const t = Translations.t.general.questions diff --git a/src/UI/Popup/DisabledQuestionsLayer.svelte b/src/UI/Popup/DisabledQuestionsLayer.svelte index 6b4509349..6460f2fac 100644 --- a/src/UI/Popup/DisabledQuestionsLayer.svelte +++ b/src/UI/Popup/DisabledQuestionsLayer.svelte @@ -2,7 +2,6 @@ /** * Gives an overview of questions which are disabled for the given theme */ - import UserRelatedState from "../../Logic/State/UserRelatedState" import LayerConfig from "../../Models/ThemeConfig/LayerConfig" import ThemeViewState from "../../Models/ThemeViewState" import Tr from "../Base/Tr.svelte" @@ -13,7 +12,7 @@ export let layer: LayerConfig export let state: ThemeViewState - let disabledQuestions = state.userRelatedState.getThemeDisabled(state.layout.id, layer.id) + let disabledQuestions = state.userRelatedState.getThemeDisabled(state.theme.id, layer.id) function getQuestion(id: string): Translation { return layer.tagRenderings.find((q) => q.id === id).question.Subs({})