| ... | @@ -226,17 +226,14 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp | ... | @@ -226,17 +226,14 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp |
| 226 | }); | 226 | }); |
| 227 | return; | 227 | return; |
| 228 | } | 228 | } |
| 229 | const promise = api.shell.openExternal(prUrl); | 229 | void api.shell.openExternal(prUrl).catch((err) => { |
| 230 | toastManager.promise(promise, { | 230 | toastManager.add({ |
| 231 | loading: { title: "Opening PR...", data: threadToastData }, | 231 | type: "error", |
| 232 | success: { title: "PR opened", data: threadToastData }, | | |
| 233 | error: (err) => ({ | | |
| 234 | title: "Unable to open PR link", | 232 | title: "Unable to open PR link", |
| 235 | description: err instanceof Error ? err.message : "An error occurred.", | 233 | description: err instanceof Error ? err.message : "An error occurred.", |
| 236 | data: threadToastData, | 234 | data: threadToastData, |
| 237 | }), | 235 | }); |
| 238 | }); | 236 | }); |
| 239 | void promise.catch(() => undefined); | | |
| 240 | }, [api, gitStatusForActions?.openPr?.url, threadToastData]); | 237 | }, [api, gitStatusForActions?.openPr?.url, threadToastData]); |
| 241 | | 238 | |
| 242 | const runGitActionWithToast = useCallback( | 239 | const runGitActionWithToast = useCallback( |