Rework preferences handling, improve search

This commit is contained in:
Pieter Vander Vennet 2024-09-10 02:19:55 +02:00
parent b45cfcaa18
commit 4085bbc1ac
19 changed files with 438 additions and 534 deletions

View file

@ -137,7 +137,6 @@ export class OsmConnection {
this.preferencesHandler = new OsmPreferences(this.auth, this, this.fakeUser)
if (options.oauth_token?.data !== undefined) {
console.log(options.oauth_token.data)
this.auth.bootstrapToken(options.oauth_token.data, (err, result) => {
console.log("Bootstrap token called back", err, result)
this.AttemptLogin()
@ -160,10 +159,10 @@ export class OsmConnection {
key: string,
defaultValue: string = undefined,
options?: {
documentation?: string
prefix?: string
}
): UIEventSource<T | undefined> {
options ??= {prefix: "mapcomplete-"}
return <UIEventSource<T>>this.preferencesHandler.GetPreference(key, defaultValue, options)
}
@ -183,7 +182,6 @@ export class OsmConnection {
this.userDetails.ping()
console.log("Logged out")
this.loadingStatus.setData("not-attempted")
this.preferencesHandler.preferences.setData(undefined)
}
/**