Skip to content

Commit

Permalink
frontend/verify email banner: do not show it when sending emails is d…
Browse files Browse the repository at this point in the history
…isabled
  • Loading branch information
haraldschilly committed Jan 6, 2025
1 parent 68f528c commit ee2d100
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/packages/frontend/app/verify-email-banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<number>(DISMISSED_KEY_LS);
Expand All @@ -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
);
}

0 comments on commit ee2d100

Please sign in to comment.