From fcfdbf56c52834f2751f3671668dc4024e986690 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 15 Sep 2020 14:00:31 +0200 Subject: [PATCH] Fix bug with strayclickhandler on desktop --- Logic/Leaflet/StrayClickHandler.ts | 1 + State.ts | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Logic/Leaflet/StrayClickHandler.ts b/Logic/Leaflet/StrayClickHandler.ts index e8275c3..0572b63 100644 --- a/Logic/Leaflet/StrayClickHandler.ts +++ b/Logic/Leaflet/StrayClickHandler.ts @@ -36,6 +36,7 @@ export class StrayClickHandler { self._lastMarker.on("click", () => { State.state.fullScreenMessage.setData(self._uiToShow()); + uiElement.Update(); }); }); diff --git a/State.ts b/State.ts index d7d4182..d63a051 100644 --- a/State.ts +++ b/State.ts @@ -173,10 +173,6 @@ export class State { ); - this.favouriteLayers = this.osmConnection.GetLongPreference("favouriteLayers").map( - str => Utils.Dedup(str?.split(";")) ?? [], - [], layers => Utils.Dedup(layers)?.join(";") - ); this.installedThemes = this.osmConnection.preferencesHandler.preferences.map<{ layout: Layout, definition: string }[]>(allPreferences => { const installedThemes: { layout: Layout, definition: string }[] = []; @@ -213,6 +209,13 @@ export class State { }); + + // IMportant: the favourite layers are initiliazed _after_ the installed themes, as these might contain an installedTheme + this.favouriteLayers = this.osmConnection.GetLongPreference("favouriteLayers").map( + str => Utils.Dedup(str?.split(";")) ?? [], + [], layers => Utils.Dedup(layers)?.join(";") + ); + Locale.language.syncWith(this.osmConnection.GetPreference("language"));