Fix: fix broken index page for anonymous users

This commit is contained in:
Pieter Vander Vennet 2025-02-05 01:26:20 +01:00
parent d9c8785d9b
commit 6260bc2897
2 changed files with 9 additions and 6 deletions

View file

@ -350,10 +350,10 @@ export default class UserRelatedState {
* List of all hidden themes that have been seen before
* @param osmConnection
*/
public static initDiscoveredHiddenThemes(osmConnection: OsmConnection): Store<string[]> {
public static initDiscoveredHiddenThemes(osmConnection: OsmConnection): Store<undefined | string[]> {
const prefix = "mapcomplete-hidden-theme-"
const userPreferences = osmConnection.preferencesHandler.allPreferences
return userPreferences.map((preferences) =>
return userPreferences.mapD((preferences) =>
Object.keys(preferences)
.filter((key) => key.startsWith(prefix))
.map((key) => key.substring(prefix.length, key.length - "-enabled".length))