From fe929aa41666481aa5d787dacbc5fe04eba5e98f Mon Sep 17 00:00:00 2001 From: Vishnu Jangid <103036831+vj2303@users.noreply.github.com> Date: Tue, 24 Mar 2026 13:41:13 +0530 Subject: [PATCH] fix: SMTP form shows incorrect rate limit message when already enabled (#43914) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fixes #43800 When editing SMTP settings while custom SMTP is already enabled, the form footer was incorrectly displaying "Rate limit for sending emails will be increased to 30". The rate limit is only set during the initial enable transition, so the message and submit behavior were out of sync. ## Changes This fix aligns the footer message with the submit logic (Option A from the issue): - **Enabling SMTP**: Shows rate limit increase message - **Already enabled, editing settings**: Shows "Custom SMTP settings will be updated" - **Disabling SMTP**: Shows rate limit reduction message ## Testing 1. Go to Authentication → SMTP Settings 2. Enable custom SMTP and save (rate limit is set to 30) 3. Edit any SMTP field (e.g. change host or port) 4. Footer now correctly shows "Custom SMTP settings will be updated" instead of the rate limit message Made with [Cursor](https://cursor.com) --------- Co-authored-by: vj2303 Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com> --- .../interfaces/Auth/SmtpForm/SmtpForm.tsx | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) 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 ( @@ -462,26 +465,22 @@ export const SmtpForm = () => { )} - {form.formState.isDirty && ( -

- {enableSmtp ? ( - <> - Rate limit for sending emails will be increased to 30 and{' '} - - can be adjusted - {' '} - after enabling custom SMTP - - ) : ( - 'Rate limit for sending emails will be reduced to 2 after disabling custom SMTP' - )} -

- )} + {showFooterMessage && + (enableSmtp ? ( +

+ Rate limit for sending emails will be increased to 30 and{' '} + + can be adjusted + {' '} + after enabling custom SMTP +

+ ) : ( +

+ Rate limit for sending emails will be reduced to 2 after disabling custom SMTP +

+ ))}
{form.formState.isDirty && (