fix(update-center): load aptss updates reliably

This commit is contained in:
2026-04-16 13:32:23 +08:00
parent 0b784af3d7
commit 309b9bc003
8 changed files with 233 additions and 14 deletions
+6 -1
View File
@@ -59,6 +59,7 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
const searchQuery = ref("");
const selectedTaskKeys = ref(new Set<string>());
const snapshot = ref<UpdateCenterSnapshot>(EMPTY_SNAPSHOT);
let lastStoreFilter: StoreFilter = "both";
const resetSessionState = (): void => {
showCloseConfirm.value = false;
@@ -131,13 +132,17 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
};
const open = async (storeFilter: StoreFilter = "both"): Promise<void> => {
lastStoreFilter = storeFilter;
resetSessionState();
const nextSnapshot = await window.updateCenter.open(storeFilter);
applySnapshot(nextSnapshot);
isOpen.value = true;
};
const refresh = async (storeFilter: StoreFilter = "both"): Promise<void> => {
const refresh = async (
storeFilter: StoreFilter = lastStoreFilter,
): Promise<void> => {
lastStoreFilter = storeFilter;
const nextSnapshot = await window.updateCenter.refresh(storeFilter);
applySnapshot(nextSnapshot);
};