From f9d2d9fd72ab691477d191b860d372977ac6c06c Mon Sep 17 00:00:00 2001 From: waltem01 Date: Thu, 15 Feb 2024 08:28:08 +0100 Subject: [PATCH] prepare sending image to server --- Webserver/src/routes/image/+page.svelte | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Webserver/src/routes/image/+page.svelte b/Webserver/src/routes/image/+page.svelte index cadd518..b53df87 100644 --- a/Webserver/src/routes/image/+page.svelte +++ b/Webserver/src/routes/image/+page.svelte @@ -9,9 +9,7 @@ let imageURL: string, uploadData: UploadData; - async function sendImage(data: ImageData) {} - - async function loadImage(url: string): Promise {} + async function sendImage() {} function uploadImage(event: Event) { // Revoke previous image url, if any @@ -30,17 +28,12 @@ {#if imageURL} User uploaded - {#await loadImage(imageURL)} -

Loading image data . . .

+ {#await sendImage()} +

Sending image . . .

{uploadData.elapsed} seconds elapsed.

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

Uploading image data . . .

-

{uploadData.elapsed} seconds elapsed.

- {:then} -

Done!

-

{uploadData.elapsed} seconds elapsed.

- {clearInterval(uploadData.interval)} - {/await} + {:then} +

Done!

+

{uploadData.elapsed} seconds elapsed.

+ {clearInterval(uploadData.interval)} {/await} {/if}