diff --git a/Logic/Osm/Changes.ts b/Logic/Osm/Changes.ts index 9da36b048a..39b9f4e02f 100644 --- a/Logic/Osm/Changes.ts +++ b/Logic/Osm/Changes.ts @@ -25,13 +25,13 @@ export class Changes implements FeatureSource { /** * All the pending changes */ - public readonly pending: UIEventSource<{ elementId: string, key: string, value: string }[]> = LocalStorageSource.GetParsed("pending-changes", []) + public readonly pending = LocalStorageSource.GetParsed<{ elementId: string, key: string, value: string }[]>("pending-changes", []) /** * All the pending new objects to upload * @private */ - private readonly newObjects: UIEventSource<{ id: number, lat: number, lon: number }[]> = LocalStorageSource.GetParsed("newObjects", []) + private readonly newObjects = LocalStorageSource.GetParsed<{ id: number, lat: number, lon: number }[]>("newObjects", []) /** * Adds a change to the pending changes diff --git a/Logic/Web/LocalStorageSource.ts b/Logic/Web/LocalStorageSource.ts index a89d2a5569..61009114af 100644 --- a/Logic/Web/LocalStorageSource.ts +++ b/Logic/Web/LocalStorageSource.ts @@ -5,7 +5,7 @@ import {UIEventSource} from "../UIEventSource"; */ export class LocalStorageSource { - static GetParsed(key: string, defaultValue : any){ + static GetParsed(key: string, defaultValue : T) : UIEventSource{ return LocalStorageSource.Get(key).map( str => { if(str === undefined){