From 5789060cdb7012a6619b53e1d5dd019f51ed39de Mon Sep 17 00:00:00 2001 From: name Date: Wed, 24 Jul 2024 15:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=87=E4=BB=B6=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C?= =?UTF-8?q?indexdb=E8=AE=B0=E5=BD=95=E6=B2=A1=E6=9C=89=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/baize-compress-image/lib/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/baize-compress-image/lib/worker.ts b/packages/baize-compress-image/lib/worker.ts index 1bb9bd0..7025619 100644 --- a/packages/baize-compress-image/lib/worker.ts +++ b/packages/baize-compress-image/lib/worker.ts @@ -35,12 +35,12 @@ self.onmessage = async (event) => { const params = JSON.parse(event.data); if (params.type === "compressImage") { const taskData = (await store.getItem(params.taskId)) as TaskType; + await store.removeItem(params.taskId); const file = taskData.file; const compressRes = await compressJpegImage({ img: file.slice(0, file.size, file.type), quality: taskData.quality || DEFAULT_QUALITY, }); - store.removeItem(params.taskId); store.setItem(params.taskId, compressRes); self.postMessage( JSON.stringify({