forked from MapComplete/MapComplete
		
	Add robustness when run via console, formatting
This commit is contained in:
		
							parent
							
								
									83af5adaea
								
							
						
					
					
						commit
						89d4a6bcce
					
				
					 11 changed files with 118 additions and 67 deletions
				
			
		|  | @ -97,6 +97,7 @@ export class Changes { | |||
|             console.log("Is already uploading... Abort") | ||||
|             return; | ||||
|         } | ||||
|         console.log("Uploading changes due to: ", flushreason) | ||||
|         this.isUploading.setData(true) | ||||
| 
 | ||||
|         this.flushChangesAsync() | ||||
|  | @ -287,7 +288,7 @@ export class Changes { | |||
|                     v = undefined; | ||||
|                 } | ||||
| 
 | ||||
|                 const oldV = obj.type[k] | ||||
|                 const oldV = obj.tags[k] | ||||
|                 if (oldV === v) { | ||||
|                     continue; | ||||
|                 } | ||||
|  |  | |||
|  | @ -66,7 +66,9 @@ export abstract class OsmObject { | |||
| 
 | ||||
|         const url = `${OsmObject.backendURL}api/0.6/${id}`; | ||||
|         const rawData = await Utils.downloadJsonCached(url, 1000) | ||||
|         return rawData.elements[0].tags | ||||
|         const tags = rawData.elements[0].tags | ||||
|         console.log("Tags are", tags) | ||||
|         return tags | ||||
|     } | ||||
| 
 | ||||
|     static async DownloadObjectAsync(id: string): Promise<OsmObject> { | ||||
|  | @ -263,7 +265,7 @@ export abstract class OsmObject { | |||
|                 continue; | ||||
|             } | ||||
|             const v = this.tags[key]; | ||||
|             if (v !== "") { | ||||
|             if (v !== "" && v !== undefined) { | ||||
|                 tags += '        <tag k="' + Utils.EncodeXmlValue(key) + '" v="' + Utils.EncodeXmlValue(this.tags[key]) + '"/>\n' | ||||
|             } | ||||
|         } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue