fix(downloads): correct add window actions

This commit is contained in:
NimBold
2026-06-20 18:51:38 +03:30
parent 894c238bb7
commit 487e1fea43
13 changed files with 278 additions and 232 deletions
+6 -2
View File
@@ -80,10 +80,14 @@ export async function initDownloadListener() {
unlistenTray = await listen<string>('tray-action', (event) => {
const mainStore = useDownloadStore.getState();
if (event.payload === 'pause-all') {
const uniqueQueues = Array.from(new Set(mainStore.downloads.map(d => d.queueId)));
const uniqueQueues = Array.from(new Set(
mainStore.downloads.map(d => d.queueId).filter((id): id is string => Boolean(id))
));
uniqueQueues.forEach(qid => mainStore.pauseQueue(qid));
} else if (event.payload === 'resume-all') {
const uniqueQueues = Array.from(new Set(mainStore.downloads.map(d => d.queueId)));
const uniqueQueues = Array.from(new Set(
mainStore.downloads.map(d => d.queueId).filter((id): id is string => Boolean(id))
));
uniqueQueues.forEach(qid => mainStore.startQueue(qid));
}
});