From 61deab705162300400ff6c869e525fb48ecc6804 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Sun, 15 Sep 2024 14:58:10 -0500 Subject: [PATCH] Nux after onboarding (#5357) * Don't show nux dialogs until post-onboarding * Don't show if over 10M --- src/components/dialogs/nuxs/TenMillion/index.tsx | 2 +- src/components/dialogs/nuxs/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/dialogs/nuxs/TenMillion/index.tsx b/src/components/dialogs/nuxs/TenMillion/index.tsx index 8d5511fd..541c6742 100644 --- a/src/components/dialogs/nuxs/TenMillion/index.tsx +++ b/src/components/dialogs/nuxs/TenMillion/index.tsx @@ -115,7 +115,7 @@ export function TenMillion() { const data = await res.json() - if (data.number) { + if (data.number && data.number <= 10_000_000) { setUserNumber(data.number) } else { // should be rare diff --git a/src/components/dialogs/nuxs/index.tsx b/src/components/dialogs/nuxs/index.tsx index 78169607..a13d99eb 100644 --- a/src/components/dialogs/nuxs/index.tsx +++ b/src/components/dialogs/nuxs/index.tsx @@ -9,6 +9,7 @@ import { useUpsertNuxMutation, } from '#/state/queries/nuxs' import {useSession} from '#/state/session' +import {useOnboardingState} from '#/state/shell' import {isSnoozed, snooze, unsnooze} from '#/components/dialogs/nuxs/snoozing' import {TenMillion} from '#/components/dialogs/nuxs/TenMillion' import {IS_DEV} from '#/env' @@ -57,7 +58,8 @@ export function useNuxDialogContext() { export function NuxDialogs() { const {hasSession} = useSession() - return hasSession ? : null + const onboardingState = useOnboardingState() + return hasSession && !onboardingState.isActive ? : null } function Inner() {