Feature(offline): attempt to upload pictures when connection is restored

This commit is contained in:
Pieter Vander Vennet 2025-08-27 00:19:13 +02:00
parent 3d225655df
commit dd0ed24f3b

View file

@ -82,10 +82,17 @@ export class ImageUploadManager {
this._changes = changes
this._gps = gpsLocation
this._reportError = reportError
Stores.chronic(5 * 60000).addCallback(() => {
Stores.chronic(5 * 60000).addCallback(async () => {
// If images failed to upload: attempt to reupload
this.uploadQueue()
await this.uploadQueue()
})
IsOnline.isOnline.addCallback(async (isOnline) => {
if (isOnline) {
await this.uploadQueue()
}
},
)
}
public async canBeUploaded(file: File): Promise<true | { error: Translation }> {