From 2bb38e0a61b6a562945ad92e9690dca03311d9ef Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 24 Sep 2024 17:52:46 +0200 Subject: [PATCH] Refactoring: remove last uses of 'GetLongPreference' --- src/Logic/Osm/OsmConnection.ts | 5 ----- src/Logic/State/UserRelatedState.ts | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Logic/Osm/OsmConnection.ts b/src/Logic/Osm/OsmConnection.ts index 03ab61fdf..d6be0d87c 100644 --- a/src/Logic/Osm/OsmConnection.ts +++ b/src/Logic/Osm/OsmConnection.ts @@ -172,11 +172,6 @@ export class OsmConnection { ): UIEventSource { return >this.preferencesHandler.getPreference(key, defaultValue, prefix) } - - public GetLongPreference(key: string, prefix: string = "mapcomplete-"): UIEventSource { - return this.preferencesHandler.getPreference(key, prefix) - } - public OnLoggedIn(action: (userDetails: UserDetails) => void) { this._onLoggedIn.push(action) } diff --git a/src/Logic/State/UserRelatedState.ts b/src/Logic/State/UserRelatedState.ts index b7fe0bc2c..e7ac6c931 100644 --- a/src/Logic/State/UserRelatedState.ts +++ b/src/Logic/State/UserRelatedState.ts @@ -42,7 +42,7 @@ export class OptionallySyncedHistory { "preference-" + key + "-history", "sync", ) - const synced = this.synced = UIEventSource.asObject(osmconnection.GetLongPreference(key + "-history"), []) + const synced = this.synced = UIEventSource.asObject(osmconnection.getPreference(key + "-history"), []) const local = this.local = LocalStorageSource.GetParsed(key + "-history", []) const thisSession = this.thisSession = new UIEventSource([], "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,