From 64cc0978074fdd28959c69220b9b839eb6e0a6ff Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 18 Jun 2024 17:07:19 -0500 Subject: [PATCH] Remove side effect --- src/Navigation.tsx | 6 +++++- src/state/shell/reminders.ts | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 9dba416d09..5d4ba0e3f7 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -53,7 +53,10 @@ import {MessagesSettingsScreen} from './screens/Messages/Settings' import {useModalControls} from './state/modals' import {useUnreadNotifications} from './state/queries/notifications/unread' import {useSession} from './state/session' -import {shouldRequestEmailConfirmation} from './state/shell/reminders' +import { + shouldRequestEmailConfirmation, + snoozeEmailConfirmationPrompt, +} from './state/shell/reminders' import {AccessibilitySettingsScreen} from './view/screens/AccessibilitySettings' import {CommunityGuidelinesScreen} from './view/screens/CommunityGuidelines' import {CopyrightPolicyScreen} from './view/screens/CopyrightPolicy' @@ -582,6 +585,7 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { if (currentAccount && shouldRequestEmailConfirmation(currentAccount)) { openModal({name: 'verify-email', showReminder: true}) + snoozeEmailConfirmationPrompt() } } diff --git a/src/state/shell/reminders.ts b/src/state/shell/reminders.ts index 6926ac2a35..db6ee9391b 100644 --- a/src/state/shell/reminders.ts +++ b/src/state/shell/reminders.ts @@ -22,7 +22,6 @@ export function shouldRequestEmailConfirmation(account: SessionAccount) { // never been snoozed, new account if (!snoozedAt) { - snoozeEmailConfirmationPrompt() return true } @@ -31,8 +30,6 @@ export function shouldRequestEmailConfirmation(account: SessionAccount) { return false } - // snooze and re-prompt - snoozeEmailConfirmationPrompt() return true }