Fix email confirmation dialog on startup (#2097)

* Move init time logging to a fn, add guard

* Fix email confirmation dialog on startup
This commit is contained in:
dan 2023-12-06 00:28:11 +00:00 committed by GitHub
parent e7f973852f
commit fab9f839d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 22 deletions

View file

@ -2,17 +2,6 @@ import * as persisted from '#/state/persisted'
import {toHashCode} from 'lib/strings/helpers'
import {isOnboardingActive} from './onboarding'
import {SessionAccount} from '../session'
import {listenSessionLoaded} from '../events'
import {unstable__openModal} from '../modals'
export function init() {
listenSessionLoaded(account => {
if (shouldRequestEmailConfirmation(account)) {
unstable__openModal({name: 'verify-email', showReminder: true})
setEmailConfirmationRequested()
}
})
}
export function shouldRequestEmailConfirmation(account: SessionAccount) {
if (!account) {