forked from MapComplete/MapComplete
Fix: add 'onbeforeunload' if images are uploading, see #1841
This commit is contained in:
parent
1c03e7ab07
commit
ce7bc8fb6c
3 changed files with 14 additions and 3 deletions
|
@ -24,6 +24,7 @@ export class ImageUploadManager {
|
|||
private readonly _uploadRetriedSuccess: Map<string, UIEventSource<number>> = new Map()
|
||||
private readonly _osmConnection: OsmConnection
|
||||
private readonly _changes: Changes
|
||||
public readonly isUploading: Store<boolean>
|
||||
|
||||
constructor(
|
||||
layout: LayoutConfig,
|
||||
|
@ -37,6 +38,13 @@ export class ImageUploadManager {
|
|||
this._layout = layout
|
||||
this._osmConnection = osmConnection
|
||||
this._changes = changes
|
||||
|
||||
const failed = this.getCounterFor(this._uploadFailed, "*")
|
||||
const done = this.getCounterFor(this._uploadFinished, "*")
|
||||
|
||||
this.isUploading = this.getCounterFor(this._uploadStarted, "*").map(startedCount => {
|
||||
return startedCount > failed.data + done.data
|
||||
}, [failed, done])
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue