mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 09:20:18 +08:00
fix:修复取消下载后无法重试下载的问题,修复重试下载后没有日志输出的问题
This commit is contained in:
@@ -884,15 +884,12 @@ const cancelDownload = (id: DownloadItem) => {
|
||||
// 发送到主进程取消
|
||||
window.ipcRenderer.send("cancel-install", download.id);
|
||||
|
||||
download.status = "failed"; // TODO: Use 'cancelled'instead of failed to type will be better though
|
||||
download.status = "failed";
|
||||
download.logs.push({
|
||||
time: Date.now(),
|
||||
message: "下载已取消",
|
||||
});
|
||||
// TODO: Remove from the list,but is it really necessary?
|
||||
// Maybe keep it with 'cancelled' status for user reference
|
||||
const idx = downloads.value.findIndex((d) => d.id === id.id);
|
||||
if (idx !== -1) downloads.value.splice(idx, 1);
|
||||
// 保留在队列中以便用户可以重试或查看日志
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user