diff --git a/Logic/Osm/OsmObject.ts b/Logic/Osm/OsmObject.ts index 6f9ec95b3..d27eec533 100644 --- a/Logic/Osm/OsmObject.ts +++ b/Logic/Osm/OsmObject.ts @@ -36,15 +36,22 @@ export abstract class OsmObject { this.backendURL = url; } - static DownloadObject(id): UIEventSource { + static DownloadObject(id: string, forceRefresh: boolean = false): UIEventSource { + let src : UIEventSource; if (OsmObject.objectCache.has(id)) { - return OsmObject.objectCache.get(id) + src = OsmObject.objectCache.get(id) + if(forceRefresh){ + src.setData(undefined) + }else{ + return src; + } + }else{ + src = new UIEventSource(undefined) } const splitted = id.split("/"); const type = splitted[0]; const idN = splitted[1]; - const src = new UIEventSource(undefined) OsmObject.objectCache.set(id, src); const newContinuation = (element: OsmObject) => { src.setData(element) @@ -158,11 +165,11 @@ export abstract class OsmObject { }) } - public static DownloadAll(neededIds): UIEventSource { + public static DownloadAll(neededIds, forceRefresh = true): UIEventSource { // local function which downloads all the objects one by one // this is one big loop, running one download, then rerunning the entire function - const allSources: UIEventSource [] = neededIds.map(id => OsmObject.DownloadObject(id)) + const allSources: UIEventSource [] = neededIds.map(id => OsmObject.DownloadObject(id, forceRefresh)) const allCompleted = new UIEventSource(undefined).map(_ => { return !allSources.some(uiEventSource => uiEventSource.data === undefined) }, allSources) diff --git a/Models/Constants.ts b/Models/Constants.ts index 1bbe8f1ce..79bcb5ca0 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import { Utils } from "../Utils"; export default class Constants { - public static vNumber = "0.8.3c"; + public static vNumber = "0.8.3d"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = {