From 0264a9bd30b09fc8159b3bcfafc5d8de44c3eee6 Mon Sep 17 00:00:00 2001 From: waltem01 Date: Fri, 16 Feb 2024 07:22:50 +0100 Subject: [PATCH] update matrix by swapping canvas buffers --- Webserver/src/routes/image/+page.svelte | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Webserver/src/routes/image/+page.svelte b/Webserver/src/routes/image/+page.svelte index 2a68d21..4343918 100644 --- a/Webserver/src/routes/image/+page.svelte +++ b/Webserver/src/routes/image/+page.svelte @@ -10,6 +10,11 @@ let imageURL: string | null, lastImage: File; let uploadData: UploadData; + async function updateMatrix() { + await fetch('/api/redirect?endpoint=update'); + clearInterval(uploadData.interval); + } + async function placeImage() { const fdata = new FormData(); fdata.append('x', '0'); @@ -109,8 +114,13 @@

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}