mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-06-22 22:23:49 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f83f8f6d80 |
@@ -14,6 +14,7 @@ import {
|
|||||||
createUpdateCenterService,
|
createUpdateCenterService,
|
||||||
type UpdateCenterIgnorePayload,
|
type UpdateCenterIgnorePayload,
|
||||||
type UpdateCenterService,
|
type UpdateCenterService,
|
||||||
|
type UpdateCenterStartTask,
|
||||||
} from "./service";
|
} from "./service";
|
||||||
import type { UpdateCenterItem } from "./types";
|
import type { UpdateCenterItem } from "./types";
|
||||||
|
|
||||||
@@ -435,8 +436,8 @@ export const registerUpdateCenterIpc = (
|
|||||||
"update-center-unignore",
|
"update-center-unignore",
|
||||||
(_event, payload: UpdateCenterIgnorePayload) => service.unignore(payload),
|
(_event, payload: UpdateCenterIgnorePayload) => service.unignore(payload),
|
||||||
);
|
);
|
||||||
ipc.handle("update-center-start", (_event, taskKeys: string[]) =>
|
ipc.handle("update-center-start", (_event, tasks: UpdateCenterStartTask[]) =>
|
||||||
service.start(taskKeys),
|
service.start(tasks),
|
||||||
);
|
);
|
||||||
ipc.handle("update-center-cancel", (_event, taskKey: string) =>
|
ipc.handle("update-center-cancel", (_event, taskKey: string) =>
|
||||||
service.cancel(taskKey),
|
service.cancel(taskKey),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { BrowserWindow, ipcMain } from "electron";
|
import { BrowserWindow } from "electron";
|
||||||
import {
|
import {
|
||||||
LEGACY_IGNORE_CONFIG_PATH,
|
LEGACY_IGNORE_CONFIG_PATH,
|
||||||
applyIgnoredEntries,
|
applyIgnoredEntries,
|
||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
} from "./ignore-config";
|
} from "./ignore-config";
|
||||||
import {
|
import {
|
||||||
createUpdateCenterQueue,
|
createUpdateCenterQueue,
|
||||||
type UpdateCenterQueue,
|
|
||||||
type UpdateCenterQueueSnapshot,
|
type UpdateCenterQueueSnapshot,
|
||||||
} from "./queue";
|
} from "./queue";
|
||||||
import type { UpdateCenterItem, UpdateSource } from "./types";
|
import type { UpdateCenterItem, UpdateSource } from "./types";
|
||||||
@@ -62,12 +61,17 @@ export interface UpdateCenterIgnorePayload {
|
|||||||
newVersion: string;
|
newVersion: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UpdateCenterStartTask {
|
||||||
|
taskKey: string;
|
||||||
|
id: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface UpdateCenterService {
|
export interface UpdateCenterService {
|
||||||
open: () => Promise<UpdateCenterServiceState>;
|
open: () => Promise<UpdateCenterServiceState>;
|
||||||
refresh: () => Promise<UpdateCenterServiceState>;
|
refresh: () => Promise<UpdateCenterServiceState>;
|
||||||
ignore: (payload: UpdateCenterIgnorePayload) => Promise<void>;
|
ignore: (payload: UpdateCenterIgnorePayload) => Promise<void>;
|
||||||
unignore: (payload: UpdateCenterIgnorePayload) => Promise<void>;
|
unignore: (payload: UpdateCenterIgnorePayload) => Promise<void>;
|
||||||
start: (taskKeys: string[]) => Promise<void>;
|
start: (tasks: UpdateCenterStartTask[]) => Promise<void>;
|
||||||
cancel: (taskKey: string) => Promise<void>;
|
cancel: (taskKey: string) => Promise<void>;
|
||||||
getState: () => UpdateCenterServiceState;
|
getState: () => UpdateCenterServiceState;
|
||||||
subscribe: (
|
subscribe: (
|
||||||
@@ -138,8 +142,6 @@ export const createUpdateCenterService = (
|
|||||||
((entries: ReadonlySet<string>) =>
|
((entries: ReadonlySet<string>) =>
|
||||||
saveIgnoredEntries(LEGACY_IGNORE_CONFIG_PATH, entries));
|
saveIgnoredEntries(LEGACY_IGNORE_CONFIG_PATH, entries));
|
||||||
|
|
||||||
let nextUpdateTaskId = 1;
|
|
||||||
|
|
||||||
const applyWarning = (message: string): void => {
|
const applyWarning = (message: string): void => {
|
||||||
queue.finishRefresh([message]);
|
queue.finishRefresh([message]);
|
||||||
};
|
};
|
||||||
@@ -188,10 +190,11 @@ export const createUpdateCenterService = (
|
|||||||
await saveIgnored(entries);
|
await saveIgnored(entries);
|
||||||
await refresh();
|
await refresh();
|
||||||
},
|
},
|
||||||
async start(taskKeys) {
|
async start(tasks) {
|
||||||
const snapshot = queue.getSnapshot();
|
const snapshot = queue.getSnapshot();
|
||||||
|
const taskIdByKey = new Map(tasks.map((task) => [task.taskKey, task.id]));
|
||||||
const selectedItems = snapshot.items.filter(
|
const selectedItems = snapshot.items.filter(
|
||||||
(item) => taskKeys.includes(getTaskKey(item)) && !item.ignored,
|
(item) => taskIdByKey.has(getTaskKey(item)) && !item.ignored,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedItems.length === 0) {
|
if (selectedItems.length === 0) {
|
||||||
@@ -211,7 +214,10 @@ export const createUpdateCenterService = (
|
|||||||
let currentItems = snapshot.items;
|
let currentItems = snapshot.items;
|
||||||
|
|
||||||
for (const item of selectedItems) {
|
for (const item of selectedItems) {
|
||||||
const updateTaskId = nextUpdateTaskId++;
|
const updateTaskId = taskIdByKey.get(getTaskKey(item));
|
||||||
|
if (updateTaskId === undefined) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// 构建 metalink URL
|
// 构建 metalink URL
|
||||||
const metalinkUrl = item.downloadUrl
|
const metalinkUrl = item.downloadUrl
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ type UpdateCenterSnapshot = {
|
|||||||
hasRunningTasks: boolean;
|
hasRunningTasks: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type UpdateCenterStartTask = {
|
||||||
|
taskKey: string;
|
||||||
|
id: number;
|
||||||
|
};
|
||||||
|
|
||||||
type IpcRendererFacade = {
|
type IpcRendererFacade = {
|
||||||
on: typeof ipcRenderer.on;
|
on: typeof ipcRenderer.on;
|
||||||
off: typeof ipcRenderer.off;
|
off: typeof ipcRenderer.off;
|
||||||
@@ -98,8 +103,8 @@ contextBridge.exposeInMainWorld("updateCenter", {
|
|||||||
packageName: string;
|
packageName: string;
|
||||||
newVersion: string;
|
newVersion: string;
|
||||||
}): Promise<void> => ipcRenderer.invoke("update-center-unignore", payload),
|
}): Promise<void> => ipcRenderer.invoke("update-center-unignore", payload),
|
||||||
start: (taskKeys: string[]): Promise<void> =>
|
start: (tasks: UpdateCenterStartTask[]): Promise<void> =>
|
||||||
ipcRenderer.invoke("update-center-start", taskKeys),
|
ipcRenderer.invoke("update-center-start", tasks),
|
||||||
cancel: (taskKey: string): Promise<void> =>
|
cancel: (taskKey: string): Promise<void> =>
|
||||||
ipcRenderer.invoke("update-center-cancel", taskKey),
|
ipcRenderer.invoke("update-center-cancel", taskKey),
|
||||||
getState: (): Promise<UpdateCenterSnapshot> =>
|
getState: (): Promise<UpdateCenterSnapshot> =>
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
|
import { createUpdateCenterService } from "../../../../electron/main/backend/update-center/service";
|
||||||
|
|
||||||
|
const electronMock = vi.hoisted(() => ({
|
||||||
|
getAllWindows: vi.fn(),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("electron", () => ({
|
||||||
|
BrowserWindow: {
|
||||||
|
getAllWindows: electronMock.getAllWindows,
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe("update-center service id forwarding", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
electronMock.getAllWindows.mockReset();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("forwards renderer-assigned ids into queue-install payloads", async () => {
|
||||||
|
const send = vi.fn();
|
||||||
|
electronMock.getAllWindows.mockReturnValue([{ webContents: { send } }]);
|
||||||
|
|
||||||
|
const service = createUpdateCenterService({
|
||||||
|
loadItems: async () => [
|
||||||
|
{
|
||||||
|
pkgname: "spark-weather",
|
||||||
|
source: "aptss",
|
||||||
|
currentVersion: "1.0.0",
|
||||||
|
nextVersion: "2.0.0",
|
||||||
|
fileName: "spark-weather.deb",
|
||||||
|
downloadUrl: "https://example.com/spark-weather.deb",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
await service.refresh();
|
||||||
|
await service.start([{ taskKey: "aptss:spark-weather", id: -1 }]);
|
||||||
|
|
||||||
|
expect(send).toHaveBeenCalledWith(
|
||||||
|
"queue-install",
|
||||||
|
JSON.stringify({
|
||||||
|
id: -1,
|
||||||
|
pkgname: "spark-weather",
|
||||||
|
metalinkUrl: "https://example.com/spark-weather.deb.metalink",
|
||||||
|
filename: "spark-weather.deb",
|
||||||
|
upgradeOnly: true,
|
||||||
|
origin: "spark",
|
||||||
|
retry: false,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -96,7 +96,12 @@ describe("updateCenter store", () => {
|
|||||||
store.toggleSelection("apm:spark-clock");
|
store.toggleSelection("apm:spark-clock");
|
||||||
await store.startSelected();
|
await store.startSelected();
|
||||||
|
|
||||||
expect(start).toHaveBeenCalledWith(["aptss:spark-weather"]);
|
expect(start).toHaveBeenCalledWith([
|
||||||
|
{
|
||||||
|
taskKey: "aptss:spark-weather",
|
||||||
|
id: downloads.value[0]?.id,
|
||||||
|
},
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("uses remoteIcon when adding update tasks to the download queue", async () => {
|
it("uses remoteIcon when adding update tasks to the download queue", async () => {
|
||||||
@@ -127,6 +132,45 @@ describe("updateCenter store", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("passes the renderer download id through to update-center start", async () => {
|
||||||
|
downloads.value = [
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
name: "Spark Notes",
|
||||||
|
pkgname: "spark-notes",
|
||||||
|
version: "1.0.0",
|
||||||
|
icon: "https://example.com/icons/spark-notes.png",
|
||||||
|
origin: "spark",
|
||||||
|
status: "queued",
|
||||||
|
progress: 0,
|
||||||
|
downloadedSize: 0,
|
||||||
|
totalSize: 1024,
|
||||||
|
speed: 0,
|
||||||
|
timeRemaining: 0,
|
||||||
|
startTime: Date.now(),
|
||||||
|
logs: [],
|
||||||
|
source: "APM Store",
|
||||||
|
retry: false,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const snapshot = createSnapshot();
|
||||||
|
open.mockResolvedValue(snapshot);
|
||||||
|
const store = createUpdateCenterStore();
|
||||||
|
|
||||||
|
await store.open();
|
||||||
|
store.toggleSelection("aptss:spark-weather");
|
||||||
|
await store.startSelected();
|
||||||
|
|
||||||
|
expect(downloads.value).toHaveLength(2);
|
||||||
|
expect(downloads.value[1]?.id).toBeLessThan(0);
|
||||||
|
expect(start).toHaveBeenCalledWith([
|
||||||
|
{
|
||||||
|
taskKey: "aptss:spark-weather",
|
||||||
|
id: downloads.value[1]?.id,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
it("blocks close requests while the snapshot reports running tasks", () => {
|
it("blocks close requests while the snapshot reports running tasks", () => {
|
||||||
const store = createUpdateCenterStore();
|
const store = createUpdateCenterStore();
|
||||||
store.isOpen.value = true;
|
store.isOpen.value = true;
|
||||||
|
|||||||
@@ -3,6 +3,34 @@ import type { DownloadItem, DownloadItemStatus } from "./typedefinition";
|
|||||||
|
|
||||||
export const downloads = ref<DownloadItem[]>([]);
|
export const downloads = ref<DownloadItem[]>([]);
|
||||||
|
|
||||||
|
let nextDownloadId = 1;
|
||||||
|
|
||||||
|
export function getNextDownloadId(): number {
|
||||||
|
if (downloads.value.length > 0) {
|
||||||
|
nextDownloadId = Math.max(
|
||||||
|
nextDownloadId,
|
||||||
|
Math.max(...downloads.value.map((item) => item.id)) + 1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const downloadId = nextDownloadId;
|
||||||
|
nextDownloadId += 1;
|
||||||
|
|
||||||
|
return downloadId;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getNextUpdateDownloadId(): number {
|
||||||
|
const negativeIds = downloads.value
|
||||||
|
.map((item) => item.id)
|
||||||
|
.filter((id) => id < 0);
|
||||||
|
|
||||||
|
if (negativeIds.length === 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Math.min(...negativeIds) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
export function removeDownloadItem(pkgname: string) {
|
export function removeDownloadItem(pkgname: string) {
|
||||||
const list = downloads.value;
|
const list = downloads.value;
|
||||||
for (let i = list.length - 1; i >= 0; i -= 1) {
|
for (let i = list.length - 1; i >= 0; i -= 1) {
|
||||||
|
|||||||
@@ -165,6 +165,11 @@ export interface UpdateCenterTaskState {
|
|||||||
errorMessage: string;
|
errorMessage: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UpdateCenterStartTask {
|
||||||
|
taskKey: string;
|
||||||
|
id: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface UpdateCenterSnapshot {
|
export interface UpdateCenterSnapshot {
|
||||||
items: UpdateCenterItem[];
|
items: UpdateCenterItem[];
|
||||||
tasks: UpdateCenterTaskState[];
|
tasks: UpdateCenterTaskState[];
|
||||||
@@ -183,7 +188,7 @@ export interface UpdateCenterBridge {
|
|||||||
packageName: string;
|
packageName: string;
|
||||||
newVersion: string;
|
newVersion: string;
|
||||||
}) => Promise<void>;
|
}) => Promise<void>;
|
||||||
start: (taskKeys: string[]) => Promise<void>;
|
start: (tasks: UpdateCenterStartTask[]) => Promise<void>;
|
||||||
cancel: (taskKey: string) => Promise<void>;
|
cancel: (taskKey: string) => Promise<void>;
|
||||||
getState: () => Promise<UpdateCenterSnapshot>;
|
getState: () => Promise<UpdateCenterSnapshot>;
|
||||||
onState: (listener: (snapshot: UpdateCenterSnapshot) => void) => void;
|
onState: (listener: (snapshot: UpdateCenterSnapshot) => void) => void;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
currentAppApmInstalled,
|
currentAppApmInstalled,
|
||||||
} from "../global/storeConfig";
|
} from "../global/storeConfig";
|
||||||
import { APM_STORE_BASE_URL } from "../global/storeConfig";
|
import { APM_STORE_BASE_URL } from "../global/storeConfig";
|
||||||
import { downloads } from "../global/downloadStatus";
|
import { downloads, getNextDownloadId } from "../global/downloadStatus";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
InstallLog,
|
InstallLog,
|
||||||
@@ -18,7 +18,6 @@ import {
|
|||||||
} from "../global/typedefinition";
|
} from "../global/typedefinition";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
let downloadIdCounter = 0;
|
|
||||||
const logger = pino({ name: "processInstall.ts" });
|
const logger = pino({ name: "processInstall.ts" });
|
||||||
|
|
||||||
export const handleInstall = async (appObj?: App) => {
|
export const handleInstall = async (appObj?: App) => {
|
||||||
@@ -51,14 +50,14 @@ export const handleInstall = async (appObj?: App) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadIdCounter += 1;
|
|
||||||
// 创建下载任务
|
// 创建下载任务
|
||||||
const arch = window.apm_store.arch || "amd64";
|
const arch = window.apm_store.arch || "amd64";
|
||||||
const finalArch =
|
const finalArch =
|
||||||
targetApp.origin === "spark" ? `${arch}-store` : `${arch}-apm`;
|
targetApp.origin === "spark" ? `${arch}-store` : `${arch}-apm`;
|
||||||
|
const downloadId = getNextDownloadId();
|
||||||
|
|
||||||
const download: DownloadItem = {
|
const download: DownloadItem = {
|
||||||
id: downloadIdCounter,
|
id: downloadId,
|
||||||
name: targetApp.name,
|
name: targetApp.name,
|
||||||
pkgname: targetApp.pkgname,
|
pkgname: targetApp.pkgname,
|
||||||
version: targetApp.version,
|
version: targetApp.version,
|
||||||
@@ -140,12 +139,12 @@ export const handleUpgrade = async (app: App) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadIdCounter += 1;
|
|
||||||
const arch = window.apm_store.arch || "amd64";
|
const arch = window.apm_store.arch || "amd64";
|
||||||
const finalArch = app.origin === "spark" ? `${arch}-store` : `${arch}-apm`;
|
const finalArch = app.origin === "spark" ? `${arch}-store` : `${arch}-apm`;
|
||||||
|
const downloadId = getNextDownloadId();
|
||||||
|
|
||||||
const download: DownloadItem = {
|
const download: DownloadItem = {
|
||||||
id: downloadIdCounter,
|
id: downloadId,
|
||||||
name: app.name,
|
name: app.name,
|
||||||
pkgname: app.pkgname,
|
pkgname: app.pkgname,
|
||||||
version: app.version,
|
version: app.version,
|
||||||
|
|||||||
+23
-12
@@ -4,8 +4,9 @@ import type {
|
|||||||
UpdateCenterItem,
|
UpdateCenterItem,
|
||||||
UpdateCenterSnapshot,
|
UpdateCenterSnapshot,
|
||||||
DownloadItem,
|
DownloadItem,
|
||||||
|
UpdateCenterStartTask,
|
||||||
} from "@/global/typedefinition";
|
} from "@/global/typedefinition";
|
||||||
import { downloads } from "@/global/downloadStatus";
|
import { downloads, getNextUpdateDownloadId } from "@/global/downloadStatus";
|
||||||
import { APM_STORE_BASE_URL } from "@/global/storeConfig";
|
import { APM_STORE_BASE_URL } from "@/global/storeConfig";
|
||||||
|
|
||||||
const EMPTY_SNAPSHOT: UpdateCenterSnapshot = {
|
const EMPTY_SNAPSHOT: UpdateCenterSnapshot = {
|
||||||
@@ -88,12 +89,18 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
|
|||||||
|
|
||||||
const allSelected = computed(() => {
|
const allSelected = computed(() => {
|
||||||
const selectable = selectableItems.value;
|
const selectable = selectableItems.value;
|
||||||
return selectable.length > 0 && selectable.every((item) => selectedTaskKeys.value.has(item.taskKey));
|
return (
|
||||||
|
selectable.length > 0 &&
|
||||||
|
selectable.every((item) => selectedTaskKeys.value.has(item.taskKey))
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const someSelected = computed(() => {
|
const someSelected = computed(() => {
|
||||||
const selectable = selectableItems.value;
|
const selectable = selectableItems.value;
|
||||||
return selectable.length > 0 && selectable.some((item) => selectedTaskKeys.value.has(item.taskKey));
|
return (
|
||||||
|
selectable.length > 0 &&
|
||||||
|
selectable.some((item) => selectedTaskKeys.value.has(item.taskKey))
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleState = (nextSnapshot: UpdateCenterSnapshot): void => {
|
const handleState = (nextSnapshot: UpdateCenterSnapshot): void => {
|
||||||
@@ -173,18 +180,13 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
|
|||||||
|
|
||||||
const startSelected = async (): Promise<void> => {
|
const startSelected = async (): Promise<void> => {
|
||||||
const selectedItems = getSelectedItems();
|
const selectedItems = getSelectedItems();
|
||||||
const taskKeys = selectedItems.map((item) => item.taskKey);
|
if (selectedItems.length === 0) {
|
||||||
|
|
||||||
if (taskKeys.length === 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 在前端创建下载项,这样用户能在下载列表中看到更新任务
|
// 在前端创建下载项,这样用户能在下载列表中看到更新任务
|
||||||
const arch = window.apm_store.arch || "amd64";
|
const arch = window.apm_store.arch || "amd64";
|
||||||
let downloadIdCounter =
|
const startTasks: UpdateCenterStartTask[] = [];
|
||||||
downloads.value.length > 0
|
|
||||||
? Math.max(...downloads.value.map((d) => d.id)) + 1
|
|
||||||
: 1;
|
|
||||||
|
|
||||||
selectedItems.forEach((item) => {
|
selectedItems.forEach((item) => {
|
||||||
// 检查任务是否已存在
|
// 检查任务是否已存在
|
||||||
@@ -200,8 +202,9 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
|
|||||||
const icon =
|
const icon =
|
||||||
item.remoteIcon ||
|
item.remoteIcon ||
|
||||||
`${APM_STORE_BASE_URL}/${finalArch}/unknown/${item.packageName}/icon.png`;
|
`${APM_STORE_BASE_URL}/${finalArch}/unknown/${item.packageName}/icon.png`;
|
||||||
|
const downloadId = getNextUpdateDownloadId();
|
||||||
const download: DownloadItem = {
|
const download: DownloadItem = {
|
||||||
id: downloadIdCounter++,
|
id: downloadId,
|
||||||
name: item.displayName,
|
name: item.displayName,
|
||||||
pkgname: item.packageName,
|
pkgname: item.packageName,
|
||||||
version: item.newVersion,
|
version: item.newVersion,
|
||||||
@@ -224,10 +227,18 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
|
|||||||
: undefined,
|
: undefined,
|
||||||
};
|
};
|
||||||
downloads.value.push(download);
|
downloads.value.push(download);
|
||||||
|
startTasks.push({
|
||||||
|
taskKey: item.taskKey,
|
||||||
|
id: downloadId,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await window.updateCenter.start(taskKeys);
|
if (startTasks.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await window.updateCenter.start(startTasks);
|
||||||
};
|
};
|
||||||
|
|
||||||
const requestClose = (): void => {
|
const requestClose = (): void => {
|
||||||
|
|||||||
Reference in New Issue
Block a user