From 259f5859686e7d6d4773d4d8e9db020cceb497d3 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 8 Nov 2023 12:11:23 -0800 Subject: [PATCH] Fix worker restart. --- cista-front/src/components/UploadButton.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cista-front/src/components/UploadButton.vue b/cista-front/src/components/UploadButton.vue index ef22c8e..b2b69d9 100644 --- a/cista-front/src/components/UploadButton.vue +++ b/cista-front/src/components/UploadButton.vue @@ -159,17 +159,18 @@ const worker = async () => { upqueue.shift() continue } - // Note: files may get modified while we're uploading, f is ours const start = f.cloudPos const end = Math.min(f.size, start + (1<<20)) const control = { name: f.cloudName, size: f.size, start, end } const data = f.slice(start, end) + f.cloudPos = end + // Note: files may get modified during I/O ws.sendMsg(control) await ws.sendData(data) - f.cloudPos = end } if (upqueue.length) startWorker() uprogress.status = "idle" + workerRunning = false } let workerRunning: any = false const startWorker = () => {