remove all software
This commit is contained in:
@@ -61,7 +61,6 @@ export const useSoftwareStore = defineStore('software', {
|
||||
});
|
||||
},
|
||||
sortedUpdates: (state) => [...state.updates].sort(sortByName),
|
||||
sortedAllSoftware: (state) => [...state.allSoftware].sort(sortByName),
|
||||
isBusy: (state) => {
|
||||
const allItems = [...state.essentials, ...state.updates, ...state.allSoftware];
|
||||
return allItems.some(item => item.status === 'pending' || item.status === 'installing');
|
||||
@@ -159,16 +158,6 @@ export const useSoftwareStore = defineStore('software', {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async fetchAll() {
|
||||
if (this.isBusy) return;
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await invoke('get_all_software')
|
||||
this.allSoftware = res as any[]
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async syncDataIfNeeded(force = false) {
|
||||
if (this.isBusy) return;
|
||||
const now = Date.now();
|
||||
@@ -187,7 +176,7 @@ export const useSoftwareStore = defineStore('software', {
|
||||
|
||||
// 然后同步本地软件安装/更新状态,不再强制联网下载 JSON
|
||||
const [all, updates] = await Promise.all([
|
||||
invoke('get_all_software'),
|
||||
invoke('get_installed_software'),
|
||||
invoke('get_updates')
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user