forked from MapComplete/MapComplete
UX: add progress bar for uploading images
This commit is contained in:
parent
bb33c43950
commit
221b572a1f
8 changed files with 45 additions and 18 deletions
|
@ -57,6 +57,9 @@ export class ImageUploadManager {
|
|||
extramessage?: string
|
||||
) => Promise<void>
|
||||
|
||||
private readonly _progressCurrentImage: UIEventSource<number> = new UIEventSource(0)
|
||||
public readonly progressCurrentImage: Store<number> = this._progressCurrentImage
|
||||
|
||||
constructor(
|
||||
layout: ThemeConfig,
|
||||
uploader: ImageUploader,
|
||||
|
@ -276,11 +279,12 @@ export class ImageUploadManager {
|
|||
let absoluteUrl: string
|
||||
|
||||
try {
|
||||
;({ key, value, absoluteUrl } = await this._uploader.uploadImage(
|
||||
({ key, value, absoluteUrl } = await this._uploader.uploadImage(
|
||||
blob,
|
||||
location,
|
||||
author,
|
||||
noblur
|
||||
noblur,
|
||||
this._progressCurrentImage
|
||||
))
|
||||
} catch (e) {
|
||||
console.error("Could again not upload image due to", e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue