From 97394a68cdd0af8f7bfebf6d973e293cf9ecea9c Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 2 Aug 2024 13:33:29 +0200 Subject: [PATCH] Small fixes to copyright-panel and restoring the state of the menus --- assets/layers/questions/questions.json | 1 - src/Logic/Web/ThemeViewStateHashActor.ts | 39 ++++++++++++---------- src/UI/BigComponents/CopyrightPanel.svelte | 5 ++- src/UI/ThemeViewGUI.svelte | 5 ++- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/assets/layers/questions/questions.json b/assets/layers/questions/questions.json index 4f0d9af5d..fdd12a12c 100644 --- a/assets/layers/questions/questions.json +++ b/assets/layers/questions/questions.json @@ -2088,7 +2088,6 @@ { "if": "internet_access=no", "icon": "wifi;cross_bottom_right:red", - "then": { "en": "This place does not offer internet access", "nl": "Deze plaats biedt geen internettoegang aan", diff --git a/src/Logic/Web/ThemeViewStateHashActor.ts b/src/Logic/Web/ThemeViewStateHashActor.ts index 817d7173a..250eecd8d 100644 --- a/src/Logic/Web/ThemeViewStateHashActor.ts +++ b/src/Logic/Web/ThemeViewStateHashActor.ts @@ -17,7 +17,7 @@ export default class ThemeViewStateHashActor { "The possible hashes are:", "", MenuState._menuviewTabs.map((tab) => "`menu:" + tab + "`").join(","), - MenuState._themeviewTabs.map((tab) => "`theme-menu:" + tab + "`").join(","), + MenuState._themeviewTabs.map((tab) => "`theme-menu:" + tab + "`").join(",") ] /** @@ -120,27 +120,30 @@ export default class ThemeViewStateHashActor { private loadStateFromHash(hash: string) { const state = this._state - const parts = hash.split(":") - outer: for (const { toggle, name, submenu } of state.guistate.allToggles) { - for (const part of parts) { - if (part === name) { + for (const superpart of hash.split(";")) { + const parts = superpart.at(-1)?.split(":") ?? [] + + outer: for (const { toggle, name, submenu } of state.guistate.allToggles) { + for (const part of parts) { + if (part.indexOf(":") < 0) { + if (part === name) { + toggle.setData(true) + continue outer + } + continue + } + const [main, submenuValue] = part.split(":") + if (part !== main) { + continue + } toggle.setData(true) + submenu?.setData(submenuValue) continue outer } - if (part.indexOf(":") < 0) { - continue - } - const [main, submenuValue] = part.split(":") - if (part !== main) { - continue - } - toggle.setData(true) - submenu?.setData(submenuValue) - continue outer - } - // If we arrive here, the loop above has not found any match - toggle.setData(false) + // If we arrive here, the loop above has not found any match + toggle.setData(false) + } } } diff --git a/src/UI/BigComponents/CopyrightPanel.svelte b/src/UI/BigComponents/CopyrightPanel.svelte index a8f3190db..3ad2dbc3b 100644 --- a/src/UI/BigComponents/CopyrightPanel.svelte +++ b/src/UI/BigComponents/CopyrightPanel.svelte @@ -13,11 +13,10 @@ import ContributorCount from "../../Logic/ContributorCount" import BaseUIElement from "../BaseUIElement" import Github from "../../assets/svg/Github.svelte" - import { DatabaseIcon, TranslateIcon } from "@rgossiaux/svelte-heroicons/solid" + import { TranslateIcon } from "@rgossiaux/svelte-heroicons/solid" import Osm_logo from "../../assets/svg/Osm_logo.svelte" import Generic_map from "../../assets/svg/Generic_map.svelte" - import { PencilIcon, UserGroupIcon, UsersIcon } from "@babeard/svelte-heroicons/solid" - import Loading from "../Base/Loading.svelte" + import { UserGroupIcon} from "@babeard/svelte-heroicons/solid" import Marker from "../Map/Marker.svelte" export let state: SpecialVisualizationState diff --git a/src/UI/ThemeViewGUI.svelte b/src/UI/ThemeViewGUI.svelte index aefe06216..6bec88568 100644 --- a/src/UI/ThemeViewGUI.svelte +++ b/src/UI/ThemeViewGUI.svelte @@ -46,7 +46,6 @@ import PendingChangesIndicator from "./BigComponents/PendingChangesIndicator.svelte" import Cross from "../assets/svg/Cross.svelte" import LanguagePicker from "./InputElement/LanguagePicker.svelte" - import Bug from "../assets/svg/Bug.svelte" import Min from "../assets/svg/Min.svelte" import Plus from "../assets/svg/Plus.svelte" import Filter from "../assets/svg/Filter.svelte" @@ -650,7 +649,7 @@ - state.guistate.privacyPanelIsOpened.setData(false)}> + state.guistate.copyrightPanelIsOpened.setData(false)}>

@@ -660,7 +659,7 @@

- new CopyrightPanel(state)} /> +