Skip to content

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

fix: SMTP form shows incorrect rate limit message when already enabled (#43914)

Vishnu Jangidfe929aa41666
diff --git a/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx b/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx
index 56a3d6d9ead..d2e7dd4699f 100644
--- a/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx
+++ b/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx
@@ -216,6 +216,9 @@ export const SmtpForm = () => {
)
}
+ const showFooterMessage =
+ form.formState.isDirty && ((enableSmtp && !isSmtpEnabled(authConfig)) || !enableSmtp)
+
return (
<PageSection>
<PageSectionContent>
@@ -462,26 +465,22 @@ export const SmtpForm = () => {
)}
<CardFooter
- className={cn(
- form.formState.isDirty ? 'justify-between' : 'justify-end',
- 'gap-x-2'
- )}
+ className={cn(showFooterMessage ? 'justify-between' : 'justify-end', 'gap-x-2')}
>
- {form.formState.isDirty && (
- <p className="text-sm text-foreground-light">
- {enableSmtp ? (
- <>
- Rate limit for sending emails will be increased to 30 and{' '}
- <InlineLink href={`/project/${projectRef}/auth/rate-limits`}>
- can be adjusted
- </InlineLink>{' '}
- after enabling custom SMTP
- </>
- ) : (
- 'Rate limit for sending emails will be reduced to 2 after disabling custom SMTP'
- )}
- </p>
- )}
+ {showFooterMessage &&
+ (enableSmtp ? (
+ <p className="text-sm text-foreground-light">
+ Rate limit for sending emails will be increased to 30 and{' '}
+ <InlineLink href={`/project/${projectRef}/auth/rate-limits`}>
+ can be adjusted
+ </InlineLink>{' '}
+ after enabling custom SMTP
+ </p>
+ ) : (
+ <p className="text-sm text-foreground-light">
+ Rate limit for sending emails will be reduced to 2 after disabling custom SMTP
+ </p>
+ ))}
<div className="flex items-center gap-x-2">
{form.formState.isDirty && (
<Button