UX: add progress bar for uploading images

This commit is contained in:
Pieter Vander Vennet 2025-05-07 16:31:00 +02:00
parent bb33c43950
commit 221b572a1f
8 changed files with 45 additions and 18 deletions

View file

@ -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)