| ... | ... | @@ -271,6 +271,9 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp |
| 271 | 271 | (action === "commit_push" || action === "commit_push_pr") && !!prUrl; |
| 272 | 272 | const shouldOfferCreatePrCta = |
| 273 | 273 | action === "commit_push" && !prUrl && result.push.status === "pushed"; |
| 274 | const closeResultToast = () => { |
| 275 | toastManager.close(progressToastId); |
| 276 | }; |
| 274 | 277 | |
| 275 | 278 | toastManager.update(progressToastId, { |
| 276 | 279 | type: "success", |
| ... | ... | @@ -281,21 +284,30 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp |
| 281 | 284 | ? { |
| 282 | 285 | actionProps: { |
| 283 | 286 | children: "Push", |
| 284 | | onClick: () => void runGitActionWithToast({ action: "commit_push" }), |
| 287 | onClick: () => { |
| 288 | closeResultToast(); |
| 289 | void runGitActionWithToast({ action: "commit_push" }); |
| 290 | }, |
| 285 | 291 | }, |
| 286 | 292 | } |
| 287 | 293 | : shouldOfferOpenPrCta |
| 288 | 294 | ? { |
| 289 | 295 | actionProps: { |
| 290 | 296 | children: "Open PR", |
| 291 | | onClick: () => void api?.shell.openExternal(prUrl), |
| 297 | onClick: () => { |
| 298 | closeResultToast(); |
| 299 | void api?.shell.openExternal(prUrl); |
| 300 | }, |
| 292 | 301 | }, |
| 293 | 302 | } |
| 294 | 303 | : shouldOfferCreatePrCta |
| 295 | 304 | ? { |
| 296 | 305 | actionProps: { |
| 297 | 306 | children: "Create PR", |
| 298 | | onClick: () => setActiveDialogAction("create_pr"), |
| 307 | onClick: () => { |
| 308 | closeResultToast(); |
| 309 | setActiveDialogAction("create_pr"); |
| 310 | }, |
| 299 | 311 | }, |
| 300 | 312 | } |
| 301 | 313 | : {}), |