Clarify intent
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import * as persisted from '#/state/persisted'
|
import * as persisted from '#/state/persisted'
|
||||||
import {toHashCode} from 'lib/strings/helpers'
|
import {toHashCode} from 'lib/strings/helpers'
|
||||||
import {isOnboardingActive} from './onboarding'
|
|
||||||
import {SessionAccount} from '../session'
|
import {SessionAccount} from '../session'
|
||||||
|
import {isOnboardingActive} from './onboarding'
|
||||||
|
|
||||||
export function shouldRequestEmailConfirmation(account: SessionAccount) {
|
export function shouldRequestEmailConfirmation(account: SessionAccount) {
|
||||||
if (!account) {
|
if (!account) {
|
||||||
@@ -17,12 +17,14 @@ export function shouldRequestEmailConfirmation(account: SessionAccount) {
|
|||||||
if (persisted.get('reminders').lastEmailConfirm) {
|
if (persisted.get('reminders').lastEmailConfirm) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const today = new Date()
|
const now = new Date()
|
||||||
|
const today = now.getDay()
|
||||||
|
const tomorrow = (today + 1) % 7
|
||||||
// shard the users into 2 day of the week buckets
|
// shard the users into 2 day of the week buckets
|
||||||
// (this is to avoid a sudden influx of email updates when
|
// (this is to avoid a sudden influx of email updates when
|
||||||
// this feature rolls out)
|
// this feature rolls out)
|
||||||
const code = toHashCode(account.did) % 7
|
const day = toHashCode(account.did) % 7
|
||||||
if (code !== today.getDay() && code !== (today.getDay() + 1) % 7) {
|
if (day !== today && day !== tomorrow) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user