diff --git a/Webserver/src/routes/image/+page.svelte b/Webserver/src/routes/image/+page.svelte index 4b8d023..d689155 100644 --- a/Webserver/src/routes/image/+page.svelte +++ b/Webserver/src/routes/image/+page.svelte @@ -17,6 +17,7 @@ let imageURL: string | null, lastImage: File; let uploadData: UploadData, matrix: Matrix; + let uploadStarted = false; async function updateMatrix() { await fetch('/api/redirect?endpoint=update'); @@ -117,26 +118,28 @@ {#if imageURL} User uploaded - {#await fileAsDataURL(lastImage, matrix.width, matrix.height)} -

Loading image data . . .

-

{uploadData.elapsed} seconds elapsed.

- {:then dataUrl} - {#await sendImage(dataUrl)} -

Sending image . . .

+ {#if uploadStarted} + {#await fileAsDataURL(lastImage, matrix.width, matrix.height)} +

Loading image data . . .

{uploadData.elapsed} seconds elapsed.

- {:then} - {#await placeImage()} -

Placing image . . .

+ {:then dataUrl} + {#await sendImage(dataUrl)} +

Sending image . . .

{uploadData.elapsed} seconds elapsed.

{:then} - {#await updateMatrix()} -

Updating matrix . . .

+ {#await placeImage()} +

Placing image . . .

{uploadData.elapsed} seconds elapsed.

{:then} -

Done!

-

{uploadData.elapsed} seconds elapsed.

+ {#await updateMatrix()} +

Updating matrix . . .

+

{uploadData.elapsed} seconds elapsed.

+ {:then} +

Done!

+

{uploadData.elapsed} seconds elapsed.

+ {/await} {/await} {/await} {/await} - {/await} + {/if} {/if}