feat: 添加贡献模式支持,增强状态管理和错误处理逻辑

This commit is contained in:
QLHazyCoder
2026-04-19 23:35:35 +08:00
parent c994d7ae12
commit 01849505e4
5 changed files with 95 additions and 1 deletions
+6
View File
@@ -372,6 +372,9 @@
case 'AUTO_RUN': {
clearStopRequest();
if (Boolean(message.payload?.contributionMode) && typeof setContributionMode === 'function') {
await setContributionMode(true);
}
const state = await getState();
if (getPendingAutoRunTimerPlan(state)) {
throw new Error('已有自动运行倒计时计划,请先取消或立即开始。');
@@ -386,6 +389,9 @@
case 'SCHEDULE_AUTO_RUN': {
clearStopRequest();
if (Boolean(message.payload?.contributionMode) && typeof setContributionMode === 'function') {
await setContributionMode(true);
}
const totalRuns = normalizeRunCount(message.payload?.totalRuns || 1);
return await scheduleAutoRun(totalRuns, {
delayMinutes: message.payload?.delayMinutes,