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"));