fix: restore manual commit dialog when autogit is off
This commit is contained in:
21
src/utils/commitEntryAction.ts
Normal file
21
src/utils/commitEntryAction.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
type RunAutomaticCheckpoint = (options?: { savePendingBeforeCommit?: boolean }) => Promise<boolean>
|
||||
type OpenCommitDialog = () => Promise<void>
|
||||
|
||||
interface CommitEntryActionConfig {
|
||||
autoGitEnabled: boolean
|
||||
openCommitDialog: OpenCommitDialog
|
||||
runAutomaticCheckpoint: RunAutomaticCheckpoint
|
||||
}
|
||||
|
||||
export function triggerCommitEntryAction({
|
||||
autoGitEnabled,
|
||||
openCommitDialog,
|
||||
runAutomaticCheckpoint,
|
||||
}: CommitEntryActionConfig): void {
|
||||
if (autoGitEnabled) {
|
||||
void runAutomaticCheckpoint({ savePendingBeforeCommit: true })
|
||||
return
|
||||
}
|
||||
|
||||
void openCommitDialog()
|
||||
}
|
||||
Reference in New Issue
Block a user