Snooze immediately after account creation, prevent showing right after signup
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
import {tryFetchGates} from '#/lib/statsig/statsig'
|
||||
import {getAge} from '#/lib/strings/time'
|
||||
import {logger} from '#/logger'
|
||||
import {snoozeEmailConfirmationPrompt} from '#/state/shell/reminders'
|
||||
import {
|
||||
configureModerationForAccount,
|
||||
configureModerationForGuest,
|
||||
@@ -191,6 +192,13 @@ export async function createAgentAndCreateAccount(
|
||||
agent.setPersonalDetails({birthDate: birthDate.toISOString()})
|
||||
}
|
||||
|
||||
try {
|
||||
// snooze first prompt after signup, defer to next prompt
|
||||
snoozeEmailConfirmationPrompt()
|
||||
} catch (e: any) {
|
||||
logger.error(e, {context: `session: failed snoozeEmailConfirmationPrompt`})
|
||||
}
|
||||
|
||||
return prepareAgent(agent, gates, moderation, onSessionChange)
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export function shouldRequestEmailConfirmation(account: SessionAccount) {
|
||||
|
||||
// never been snoozed, new account
|
||||
if (!snoozedAt) {
|
||||
snooze()
|
||||
snoozeEmailConfirmationPrompt()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -34,16 +34,16 @@ export function shouldRequestEmailConfirmation(account: SessionAccount) {
|
||||
|
||||
// snoozed recently
|
||||
if (snoozedAt !== today) {
|
||||
snooze()
|
||||
snoozeEmailConfirmationPrompt()
|
||||
return true
|
||||
}
|
||||
|
||||
// should never happen
|
||||
snooze()
|
||||
snoozeEmailConfirmationPrompt()
|
||||
return true
|
||||
}
|
||||
|
||||
export function snooze() {
|
||||
export function snoozeEmailConfirmationPrompt() {
|
||||
const lastEmailConfirm = new Date().toISOString()
|
||||
logger.debug('Snoozing email confirmation reminder', {
|
||||
snoozedAt: lastEmailConfirm,
|
||||
|
||||
Reference in New Issue
Block a user