forked from MapComplete/MapComplete
Add preferences panel
This commit is contained in:
parent
bd43e2537f
commit
2e7688a554
5 changed files with 98 additions and 21 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue