From ee2d100b012fcbf76195175206fe3058e5feddb1 Mon Sep 17 00:00:00 2001 From: Harald Schilly Date: Mon, 6 Jan 2025 14:53:01 +0100 Subject: [PATCH] frontend/verify email banner: do not show it when sending emails is disabled --- src/packages/frontend/app/verify-email-banner.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/packages/frontend/app/verify-email-banner.tsx b/src/packages/frontend/app/verify-email-banner.tsx index 075f7972ed..eea5343f5c 100644 --- a/src/packages/frontend/app/verify-email-banner.tsx +++ b/src/packages/frontend/app/verify-email-banner.tsx @@ -150,6 +150,8 @@ export function useShowVerifyEmail(): boolean { setLoaded(true); }, []); + const emailSendingEnabled = useTypedRedux("customize", "email_enabled"); + const created = useTypedRedux("account", "created"); const dismissedTS = LS.get(DISMISSED_KEY_LS); @@ -166,5 +168,11 @@ export function useShowVerifyEmail(): boolean { const dismissed = typeof dismissedTS === "number" && now < dismissedTS + 7 * oneDay; - return show_verify_email && loaded && notTooNew && !dismissed; + return ( + show_verify_email && + loaded && + notTooNew && + !dismissed && + emailSendingEnabled + ); }