Refactoring: remove last uses of 'GetLongPreference'

This commit is contained in:
Pieter Vander Vennet 2024-09-24 17:52:46 +02:00
parent 22c8a45012
commit 2bb38e0a61
2 changed files with 3 additions and 8 deletions

View file

@ -172,11 +172,6 @@ export class OsmConnection {
): UIEventSource<T | undefined> {
return <UIEventSource<T>>this.preferencesHandler.getPreference(key, defaultValue, prefix)
}
public GetLongPreference(key: string, prefix: string = "mapcomplete-"): UIEventSource<string> {
return this.preferencesHandler.getPreference(key, prefix)
}
public OnLoggedIn(action: (userDetails: UserDetails) => void) {
this._onLoggedIn.push(action)
}

View file

@ -42,7 +42,7 @@ export class OptionallySyncedHistory<T> {
"preference-" + key + "-history",
"sync",
)
const synced = this.synced = UIEventSource.asObject<T[]>(osmconnection.GetLongPreference(key + "-history"), [])
const synced = this.synced = UIEventSource.asObject<T[]>(osmconnection.getPreference(key + "-history"), [])
const local = this.local = LocalStorageSource.GetParsed<T[]>(key + "-history", [])
const thisSession = this.thisSession = new UIEventSource<T[]>([], "optionally-synced:"+key+"(session only)")
this.syncPreference.addCallback(syncmode => {
@ -273,7 +273,7 @@ export default class UserRelatedState {
}
public getUnofficialTheme(id: string): (MinimalLayoutInformation & { definition }) | undefined {
const pref = this.osmConnection.GetLongPreference("unofficial-theme-" + id)
const pref = this.osmConnection.getPreference("unofficial-theme-" + id)
const str = pref.data
if (str === undefined || str === "undefined" || str === "") {
@ -311,7 +311,7 @@ export default class UserRelatedState {
})
}
if (!layout.official) {
this.osmConnection.GetLongPreference("unofficial-theme-" + layout.id).setData(
this.osmConnection.getPreference("unofficial-theme-" + layout.id).setData(
JSON.stringify({
id: layout.id,
icon: layout.icon,