forked from MapComplete/MapComplete
		
	Fix 'stabilized'
This commit is contained in:
		
							parent
							
								
									36ac99c9ec
								
							
						
					
					
						commit
						a4916a9b6d
					
				
					 3 changed files with 6 additions and 6 deletions
				
			
		|  | @ -9,7 +9,10 @@ export class NewGeometryFromChangesFeatureSource implements FeatureSource { | |||
|     // This class name truly puts the 'Java' into 'Javascript'
 | ||||
| 
 | ||||
|     /** | ||||
|      * A feature source containing exclusively new elements | ||||
|      * A feature source containing exclusively new elements. | ||||
|      *  | ||||
|      * These elements are probably created by the 'SimpleAddUi' which generates a new point, but the import functionality might create a line or polygon too. | ||||
|      * Other sources of new points are e.g. imports from nodes | ||||
|      */ | ||||
|     public readonly features: UIEventSource<{ feature: any; freshness: Date }[]> = new UIEventSource<{ feature: any; freshness: Date }[]>([]); | ||||
|     public readonly name: string = "newFeatures"; | ||||
|  |  | |||
|  | @ -227,12 +227,9 @@ export abstract class Store<T> { | |||
| 
 | ||||
|         const newSource = new UIEventSource<T>(this.data); | ||||
| 
 | ||||
|         let currentCallback = 0; | ||||
|         this.addCallback(latestData => { | ||||
|             currentCallback++; | ||||
|             const thisCallback = currentCallback; | ||||
|             window.setTimeout(() => { | ||||
|                 if (thisCallback === currentCallback) { | ||||
|                 if (this.data == latestData) { // compare by reference
 | ||||
|                     newSource.setData(latestData); | ||||
|                 } | ||||
|             }, millisToStabilize) | ||||
|  |  | |||
|  | @ -81,7 +81,7 @@ export default class SimpleAddUI extends Toggle { | |||
|         const presetsOverview = SimpleAddUI.CreateAllPresetsPanel(selectedPreset, state) | ||||
| 
 | ||||
| 
 | ||||
|         async function createNewPoint(tags: any[], location: { lat: number, lon: number }, snapOntoWay?: OsmWay) { | ||||
|         async function createNewPoint(tags: any[], location: { lat: number, lon: number }, snapOntoWay?: OsmWay) : Promise<void>{ | ||||
|             const newElementAction = new CreateNewNodeAction(tags, location.lat, location.lon, { | ||||
|                 theme: state.layoutToUse?.id ?? "unkown", | ||||
|                 changeType: "create", | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue