prepare image upload steps

This commit is contained in:
waltem01 2024-02-15 08:13:44 +01:00
parent d75b74965b
commit 664c58e863

View File

@ -9,7 +9,9 @@
let imageURL: string, uploadData: UploadData;
async function loadImage(url: string) {}
async function sendImage(data: ImageData) {}
async function loadImage(url: string): Promise<ImageData> {}
function uploadImage(event: Event) {}
</script>
@ -18,11 +20,16 @@
{#if imageURL}
<img src={imageURL} alt="User uploaded" />
{#await loadImage(imageURL)}
<p>Loading image . . .</p>
<p>Loading image data . . .</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{:then imageData}
<p>Done!</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{clearInterval(uploadData.interval)}
{:then data}
{#await sendImage(data)}
<p>Uploading image data . . .</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{:then}
<p>Done!</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{clearInterval(uploadData.interval)}
{/await}
{/await}
{/if}