update matrix by swapping canvas buffers

This commit is contained in:
waltem01 2024-02-16 07:22:50 +01:00
parent 6a2e1f48f9
commit 0264a9bd30

View File

@ -10,6 +10,11 @@
let imageURL: string | null, lastImage: File; let imageURL: string | null, lastImage: File;
let uploadData: UploadData; let uploadData: UploadData;
async function updateMatrix() {
await fetch('/api/redirect?endpoint=update');
clearInterval(uploadData.interval);
}
async function placeImage() { async function placeImage() {
const fdata = new FormData(); const fdata = new FormData();
fdata.append('x', '0'); fdata.append('x', '0');
@ -109,8 +114,13 @@
<p>Placing image . . .</p> <p>Placing image . . .</p>
<p>{uploadData.elapsed} seconds elapsed.</p> <p>{uploadData.elapsed} seconds elapsed.</p>
{:then} {:then}
<p>Done!</p> {#await updateMatrix()}
<p>{uploadData.elapsed} seconds elapsed.</p> <p>Updating matrix . . .</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{:then}
<p>Done!</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{/await}
{/await} {/await}
{/await} {/await}
{/await} {/await}