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
				
			
		|  | @ -21,11 +21,13 @@ export default class AllImageProviders { | |||
|         ) | ||||
|              | ||||
|     ] | ||||
|      | ||||
|     public static defaultKeys = [].concat(AllImageProviders.ImageAttributionSource.map(provider => provider.defaultKeyPrefixes)) | ||||
| 
 | ||||
| 
 | ||||
|     private static _cache: Map<string, UIEventSource<ProvidedImage[]>> = new Map<string, UIEventSource<ProvidedImage[]>>() | ||||
| 
 | ||||
|     public static LoadImagesFor(tags: UIEventSource<any>, tagKey?: string): UIEventSource<ProvidedImage[]> { | ||||
|     public static LoadImagesFor(tags: UIEventSource<any>, tagKey?: string[]): UIEventSource<ProvidedImage[]> { | ||||
|         if (tags.data.id === undefined) { | ||||
|             return undefined; | ||||
|         } | ||||
|  | @ -44,7 +46,7 @@ export default class AllImageProviders { | |||
|              | ||||
|             let prefixes = imageProvider.defaultKeyPrefixes | ||||
|             if(tagKey !== undefined){ | ||||
|                 prefixes = [...prefixes, tagKey] | ||||
|                 prefixes = tagKey | ||||
|             } | ||||
|              | ||||
|             const singleSource = imageProvider.GetRelevantUrls(tags, { | ||||
|  |  | |||
|  | @ -27,7 +27,8 @@ export default class ImgurUploader { | |||
|             files, | ||||
|             function (url) { | ||||
|                 console.log("File saved at", url); | ||||
|                 self.success.setData([...self.success.data, url]); | ||||
|                 self.success.data.push(url) | ||||
|                 self.success.ping(); | ||||
|                 self._handleSuccessUrl(url); | ||||
|             }, | ||||
|             function () { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue