forked from MapComplete/MapComplete
Rework preferences handling, improve search
This commit is contained in:
parent
b45cfcaa18
commit
4085bbc1ac
19 changed files with 438 additions and 534 deletions
|
|
@ -188,18 +188,4 @@ export default class MoreScreen {
|
|||
return `${linkPrefix}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Gives all the IDs of the hidden themes which were previously visited
|
||||
* @param osmConnection
|
||||
*/
|
||||
public static knownHiddenThemes(osmConnection: OsmConnection): Store<Set<string>> {
|
||||
const prefix = "mapcomplete-hidden-theme-"
|
||||
const userPreferences = osmConnection.preferencesHandler.preferences
|
||||
return userPreferences.map((preferences) =>
|
||||
new Set<string>(
|
||||
Object.keys(preferences)
|
||||
.filter((key) => key.startsWith(prefix))
|
||||
.map((key) => key.substring(prefix.length, key.length - "-enabled".length))
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue