fix(sources): hide unavailable update and management entries

This commit is contained in:
2026-04-16 13:04:54 +08:00
parent e1ec526cb9
commit 0b784af3d7
16 changed files with 667 additions and 58 deletions
+6 -4
View File
@@ -1,5 +1,7 @@
import { ipcRenderer, contextBridge, type IpcRendererEvent } from "electron";
type StoreFilter = "spark" | "apm" | "both";
type UpdateCenterSnapshot = {
items: Array<{
taskKey: string;
@@ -90,10 +92,10 @@ contextBridge.exposeInMainWorld("apm_store", {
});
contextBridge.exposeInMainWorld("updateCenter", {
open: (): Promise<UpdateCenterSnapshot> =>
ipcRenderer.invoke("update-center-open"),
refresh: (): Promise<UpdateCenterSnapshot> =>
ipcRenderer.invoke("update-center-refresh"),
open: (storeFilter: StoreFilter = "both"): Promise<UpdateCenterSnapshot> =>
ipcRenderer.invoke("update-center-open", storeFilter),
refresh: (storeFilter: StoreFilter = "both"): Promise<UpdateCenterSnapshot> =>
ipcRenderer.invoke("update-center-refresh", storeFilter),
ignore: (payload: {
packageName: string;
newVersion: string;