TypeScript
Close result toast only after push confirmation
Julius Marmingecce74f913c03
diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsxindex 49d3d82a976..c189145cf16 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 }: GitActionsControlPropaction,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 }: GitActionsControlProptitle: 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: {