forked from MapComplete/MapComplete
Feature(imagequeue): (hopefully) handle some edge cases correctly
This commit is contained in:
parent
6925b3d26e
commit
aa373ee698
4 changed files with 21 additions and 6 deletions
|
|
@ -2,7 +2,7 @@ import { IdbLocalStorage } from "../Web/IdbLocalStorage"
|
|||
import { Store, UIEventSource } from "../UIEventSource"
|
||||
|
||||
export interface ImageUploadArguments {
|
||||
readonly featureId: string,
|
||||
featureId: string,
|
||||
readonly author: string,
|
||||
readonly blob: File,
|
||||
readonly targetKey: string | undefined,
|
||||
|
|
@ -43,4 +43,17 @@ export default class ImageUploadQueue {
|
|||
this._imagesInQueue.ping()
|
||||
}
|
||||
|
||||
applyRemapping(oldId: string, newId: string) {
|
||||
|
||||
let hasChange = false
|
||||
for (const img of this._imagesInQueue.data) {
|
||||
if (img.featureId === oldId) {
|
||||
img.featureId = newId
|
||||
hasChange = true
|
||||
}
|
||||
}
|
||||
if (hasChange) {
|
||||
this._imagesInQueue.ping()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue