Add preferences panel

This commit is contained in:
Pieter Vander Vennet 2020-08-07 16:01:18 +02:00
parent bd43e2537f
commit 2e7688a554
5 changed files with 98 additions and 21 deletions

View file

@ -162,12 +162,12 @@ export class OsmConnection {
public preferences = new UIEventSource<any>({});
public preferenceSources : any = {}
public GetPreference(key: string) : UIEventSource<string>{
key = "mapcomplete-"+key;
public GetPreference(key: string, prefix : string = "mapcomplete-") : UIEventSource<string>{
key = prefix+key;
if (this.preferenceSources[key] !== undefined) {
return this.preferenceSources[key];
}
if (this.userDetails.data.loggedIn) {
if (this.userDetails.data.loggedIn && this.preferences.data[key] === undefined) {
this.UpdatePreferences();
}
const pref = new UIEventSource<string>(this.preferences.data[key]);