Skip to content

Commit

Permalink
🐛 修复上传文件为空时,indexdb记录没有删除
Browse files Browse the repository at this point in the history
  • Loading branch information
name committed Jul 24, 2024
1 parent 06ebbb9 commit 5789060
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/baize-compress-image/lib/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 5789060

Please sign in to comment.