MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / normalizeAutoRunTimerPlanFromState

Function normalizeAutoRunTimerPlanFromState

background.js:471–493  ·  view source on GitHub ↗
(state = {})

Source from the content-addressed store, hash-verified

469}
470
471function normalizeAutoRunTimerPlanFromState(state = {}) {
472 const directPlan = normalizeAutoRunTimerPlan(state.autoRunTimerPlan);
473 if (directPlan) {
474 return directPlan;
475 }
476
477 if (state.autoRunPhase !== 'scheduled') {
478 return null;
479 }
480
481 const legacyScheduledAt = Number(state.scheduledAutoRunAt);
482 if (!Number.isFinite(legacyScheduledAt)) {
483 return null;
484 }
485
486 return normalizeAutoRunTimerPlan({
487 kind: AUTO_RUN_TIMER_KIND_SCHEDULED_START,
488 fireAt: legacyScheduledAt,
489 totalRuns: state.scheduledAutoRunPlan?.totalRuns ?? state.autoRunTotalRuns,
490 autoRunSkipFailures: state.scheduledAutoRunPlan?.autoRunSkipFailures ?? state.autoRunSkipFailures,
491 mode: state.scheduledAutoRunPlan?.mode,
492 });
493}
494
495function getAutoRunTimerPlanPhase(kind = '') {
496 return kind === AUTO_RUN_TIMER_KIND_SCHEDULED_START ? 'scheduled' : 'waiting_interval';

Callers 2

isAutoRunScheduledStateFunction · 0.85

Calls 1

Tested by

no test coverage detected