forked from MapComplete/MapComplete
		
	Refactoring: remove last uses of 'GetLongPreference'
This commit is contained in:
		
							parent
							
								
									22c8a45012
								
							
						
					
					
						commit
						2bb38e0a61
					
				
					 2 changed files with 3 additions and 8 deletions
				
			
		|  | @ -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) | ||||
|     } | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue