diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 49d3d82a976c2a1cc457970d7578710506a35faa..c189145cf16c823286ff2bd98b6356d0f7db2ccd 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -215,13 +215,16 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp action, commitMessage, forcePushOnlyProgress = false, + onConfirmed, }: { action: GitStackedAction; commitMessage?: string; forcePushOnlyProgress?: boolean; + onConfirmed?: () => void; }) => { const confirmed = await maybeConfirmPushToDefaultBranch(action); if (!confirmed) return; + onConfirmed?.(); const progressStages = buildGitActionProgressStages({ action, @@ -274,19 +277,19 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp title: resultToast.title, description: resultToast.description, timeout: 0, - ...(shouldOfferPushCta - ? { - actionProps: { - children: "Push", - onClick: () => { - closeResultToast(); - void runGitActionWithToast({ - action: "commit_push", - forcePushOnlyProgress: true, - }); - }, - }, - } + ...(shouldOfferPushCta + ? { + actionProps: { + children: "Push", + onClick: () => { + void runGitActionWithToast({ + action: "commit_push", + forcePushOnlyProgress: true, + onConfirmed: closeResultToast, + }); + }, + }, + } : shouldOfferOpenPrCta ? { actionProps: {