fix(sync): honor per-spoon auto-sync settings
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
export const shouldAutoSync = (
|
||||
settings: {
|
||||
autoSyncEnabled: boolean;
|
||||
requireCleanCompareForSync: boolean;
|
||||
},
|
||||
ctx: { status: string; forkAheadBy: number },
|
||||
): boolean => {
|
||||
if (!settings.autoSyncEnabled) return false;
|
||||
if (ctx.status !== 'behind') return false;
|
||||
if (settings.requireCleanCompareForSync && ctx.forkAheadBy !== 0) {
|
||||
return false;
|
||||
}
|
||||
return ctx.forkAheadBy === 0;
|
||||
};
|
||||
|
||||
export const shouldCreateReviewThread = (
|
||||
settings: { autoReviewEnabled: boolean },
|
||||
ctx: { status: string },
|
||||
): boolean => settings.autoReviewEnabled && ctx.status === 'diverged';
|
||||
Reference in New Issue
Block a user