Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(studio): suppress error toast when GitHub connection already exists (#44972)

Andrew Valleteau5caa75e0af5c
diff --git a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx
index ed1468e76c4..c1c7d6412ef 100644
--- a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx
+++ b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx
@@ -137,6 +137,13 @@ export const GitHubIntegrationConnectionForm = ({
onSuccess: () => {
toast.success('GitHub integration successfully updated')
},
+ onError: (error) => {
+ // Don't show error toast when connection already exists - the branch
+ // settings update will still proceed and show its own success toast
+ if (!error.message?.includes('already exists')) {
+ toast.error(`Failed to create GitHub connection: ${error.message}`)
+ }
+ },
})
const { mutateAsync: deleteConnection, isPending: isDeletingConnection } =