Skip to content

Commit d3b754f

Browse files
committed
fix(mcp): close the blank popup when post-start navigation fails
1 parent 0a5e5dd commit d3b754f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/sim/hooks/mcp/use-mcp-oauth-popup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ export function useMcpOauthPopup({ workspaceId }: UseMcpOauthPopupProps) {
194194
navigated = window.open(authorizationUrl, `mcp-oauth-${serverId}`) !== null
195195
}
196196
if (!navigated) {
197+
try {
198+
popup.close()
199+
} catch {}
197200
decConnecting(serverId)
198201
toast.error('Popup blocked. Please allow popups for this site and retry.')
199202
return

0 commit comments

Comments
 (0)