forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
79b6927b56
commit
42ded4c1b1
328 changed files with 4062 additions and 1284 deletions
|
|
@ -2,12 +2,12 @@ import { IdbLocalStorage } from "../Web/IdbLocalStorage"
|
|||
import { Store, UIEventSource } from "../UIEventSource"
|
||||
|
||||
export interface ImageUploadArguments {
|
||||
featureId: string,
|
||||
readonly author: string,
|
||||
readonly blob: File,
|
||||
readonly targetKey: string | undefined,
|
||||
readonly noblur: boolean,
|
||||
readonly location: [number, number],
|
||||
featureId: string
|
||||
readonly author: string
|
||||
readonly blob: File
|
||||
readonly targetKey: string | undefined
|
||||
readonly noblur: boolean
|
||||
readonly location: [number, number]
|
||||
readonly layoutId: string
|
||||
readonly date: number
|
||||
}
|
||||
|
|
@ -17,14 +17,15 @@ export interface ImageUploadArguments {
|
|||
* It is backed up in the indexedDB as to not drop images in case of connection problems
|
||||
*/
|
||||
export default class ImageUploadQueue {
|
||||
|
||||
public static readonly singleton = new ImageUploadQueue()
|
||||
private readonly _imagesInQueue: UIEventSource<ImageUploadArguments[]>
|
||||
|
||||
public readonly imagesInQueue: Store<ImageUploadArguments[]>
|
||||
|
||||
private constructor() {
|
||||
this._imagesInQueue = IdbLocalStorage.Get<ImageUploadArguments[]>("failed-images-backup", { defaultValue: [] })
|
||||
this._imagesInQueue = IdbLocalStorage.Get<ImageUploadArguments[]>("failed-images-backup", {
|
||||
defaultValue: [],
|
||||
})
|
||||
this.imagesInQueue = this._imagesInQueue
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +45,6 @@ export default class ImageUploadQueue {
|
|||
}
|
||||
|
||||
applyRemapping(oldId: string, newId: string) {
|
||||
|
||||
let hasChange = false
|
||||
for (const img of this._imagesInQueue.data) {
|
||||
if (img.featureId === oldId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue