diff --git a/src/components/config/AutomationSettings.tsx b/src/components/config/AutomationSettings.tsx index 49afb1f..f166aba 100644 --- a/src/components/config/AutomationSettings.tsx +++ b/src/components/config/AutomationSettings.tsx @@ -269,6 +269,31 @@ export function AutomationSettings({ + +
+ + onScheduleChange({ + ...scheduleConfig, + autoMirror: !!checked, + }) + } + /> +
+ +

+ Automatically mirror newly imported repositories on each scheduled sync. When off, new repos are imported for browsing but require a manual mirror click. (Starred repos have their own toggle in GitHub settings.) +

+
+
)} diff --git a/src/lib/utils/config-mapper.ts b/src/lib/utils/config-mapper.ts index de4d178..00b0c56 100644 --- a/src/lib/utils/config-mapper.ts +++ b/src/lib/utils/config-mapper.ts @@ -246,6 +246,7 @@ export function mapUiScheduleToDb(uiSchedule: any, existing?: DbScheduleConfig): enabled: !!uiSchedule.enabled, interval: intervalExpression, timezone, + autoMirror: typeof uiSchedule.autoMirror === "boolean" ? uiSchedule.autoMirror : base.autoMirror, nextRun: scheduleChanged ? undefined : base.nextRun, } as DbScheduleConfig; } @@ -264,6 +265,7 @@ export function mapDbScheduleToUi(dbSchedule: DbScheduleConfig): any { clockFrequencyHours: 24, startTime: "22:00", timezone: "UTC", + autoMirror: false, lastRun: null, nextRun: null, }; @@ -296,6 +298,7 @@ export function mapDbScheduleToUi(dbSchedule: DbScheduleConfig): any { clockFrequencyHours: parsedClockSchedule?.frequencyHours ?? 24, startTime: parsedClockSchedule?.startTime ?? "22:00", timezone: normalizeTimezone(dbSchedule.timezone || "UTC"), + autoMirror: dbSchedule.autoMirror ?? false, lastRun: dbSchedule.lastRun || null, nextRun: dbSchedule.nextRun || null, }; diff --git a/src/types/config.ts b/src/types/config.ts index 47bc71a..b9e969b 100644 --- a/src/types/config.ts +++ b/src/types/config.ts @@ -36,6 +36,7 @@ export interface ScheduleConfig { clockFrequencyHours?: number; startTime?: string; timezone?: string; + autoMirror?: boolean; lastRun?: Date; nextRun?: Date; }