fix: resolve scheduler infinite loop and frozen delete modal bugs

This commit is contained in:
NimBold
2026-06-21 14:28:21 +03:30
parent de1318deb6
commit 3660ceb47a
4 changed files with 26 additions and 16 deletions
+5 -2
View File
@@ -218,10 +218,13 @@ function App() {
useEffect(() => {
const unlisten = listen('schedule-trigger', async (event) => {
const state = useSettingsStore.getState();
if (event.payload === 'start') {
const payload = event.payload as any;
if (payload.action === 'start') {
state.setSchedulerLastStartKey(payload.key);
const started = await useDownloadStore.getState().startQueue(MAIN_QUEUE_ID);
state.setSchedulerRunning(started > 0);
} else if (event.payload === 'stop') {
} else if (payload.action === 'stop') {
state.setSchedulerLastStopKey(payload.key);
await useDownloadStore.getState().pauseQueue(MAIN_QUEUE_ID);
state.setSchedulerRunning(false);
}