fix(update): 统一忽略更新配置到用户目录

This commit is contained in:
2026-04-15 11:44:18 +08:00
parent 51664619f5
commit 36f5d3831e
18 changed files with 486 additions and 104 deletions

View File

@@ -30,6 +30,8 @@ export interface UpdateCenterStore {
unbind: () => void;
open: () => Promise<void>;
refresh: () => Promise<void>;
ignoreItem: (packageName: string, newVersion: string) => Promise<void>;
unignoreItem: (packageName: string, newVersion: string) => Promise<void>;
toggleSelection: (taskKey: string) => void;
toggleSelectAll: () => void;
getSelectedItems: () => UpdateCenterItem[];
@@ -139,6 +141,20 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
applySnapshot(nextSnapshot);
};
const ignoreItem = async (
packageName: string,
newVersion: string,
): Promise<void> => {
await window.updateCenter.ignore({ packageName, newVersion });
};
const unignoreItem = async (
packageName: string,
newVersion: string,
): Promise<void> => {
await window.updateCenter.unignore({ packageName, newVersion });
};
const toggleSelection = (taskKey: string): void => {
const item = snapshot.value.items.find(
(entry) => entry.taskKey === taskKey,
@@ -260,6 +276,8 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
unbind,
open,
refresh,
ignoreItem,
unignoreItem,
toggleSelection,
toggleSelectAll,
getSelectedItems,