mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-13 13:06:52 +00:00
fix: resolve scheduler infinite loop and frozen delete modal bugs
This commit is contained in:
+5
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user