mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-30 03:10:16 +08:00
fix(update): 统一忽略更新配置到用户目录
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user