forked from MapComplete/MapComplete
UX: add proper delete dialog, add option to report images
This commit is contained in:
parent
8690ad35bb
commit
5b618dc367
18 changed files with 334 additions and 176 deletions
|
@ -66,8 +66,9 @@ export default class AllImageProviders {
|
|||
return AllImageProviders.genericImageProvider
|
||||
}
|
||||
|
||||
private static readonly _cachedImageStores: Record<string, Store<ProvidedImage[]>> = {}
|
||||
/**
|
||||
* Tries to extract all image data for this image
|
||||
* Tries to extract all image data for this image. Cachedon tags?.data?.id
|
||||
*/
|
||||
public static LoadImagesFor(
|
||||
tags: Store<Record<string, string>>,
|
||||
|
@ -76,6 +77,10 @@ export default class AllImageProviders {
|
|||
if (tags?.data?.id === undefined) {
|
||||
return undefined
|
||||
}
|
||||
const id = tags?.data?.id
|
||||
if(this._cachedImageStores[id]){
|
||||
return this._cachedImageStores[id]
|
||||
}
|
||||
|
||||
const source = new UIEventSource([])
|
||||
const allSources: Store<ProvidedImage[]>[] = []
|
||||
|
@ -93,6 +98,7 @@ export default class AllImageProviders {
|
|||
source.set(dedup)
|
||||
})
|
||||
}
|
||||
this._cachedImageStores[id] = source
|
||||
return source
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue