about summary refs log tree commit diff
path: root/src/components/dialogs/nuxs/index.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-11-16 21:39:47 +0000
committerGitHub <noreply@github.com>2024-11-16 21:39:47 +0000
commitedaf230612f688512c71a66a99742e558620ebd3 (patch)
tree68840eeb473dd77c0f040bd6fa206c9ad2961a75 /src/components/dialogs/nuxs/index.tsx
parent9bbea3f33a9a17285d8ec58003b598a911c192a1 (diff)
downloadvoidsky-edaf230612f688512c71a66a99742e558620ebd3.tar.zst
Remove typography NUX and consistently call upsertProfile (#6424)
* Make profile upsert unconditional

* Remove Typography NUX

* Early exit NUXes on unknown creation date

* Clarify via comment
Diffstat (limited to 'src/components/dialogs/nuxs/index.tsx')
-rw-r--r--src/components/dialogs/nuxs/index.tsx26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/components/dialogs/nuxs/index.tsx b/src/components/dialogs/nuxs/index.tsx
index d17615aeb..701ae84e6 100644
--- a/src/components/dialogs/nuxs/index.tsx
+++ b/src/components/dialogs/nuxs/index.tsx
@@ -19,7 +19,6 @@ import {useOnboardingState} from '#/state/shell'
 /*
  * NUXs
  */
-import {NeueTypography} from '#/components/dialogs/nuxs/NeueTypography'
 import {isSnoozed, snooze, unsnooze} from '#/components/dialogs/nuxs/snoozing'
 import {IS_DEV} from '#/env'
 
@@ -36,19 +35,7 @@ const queuedNuxs: {
     currentProfile: AppBskyActorDefs.ProfileViewDetailed
     preferences: UsePreferencesQueryResponse
   }) => boolean
-}[] = [
-  {
-    id: Nux.NeueTypography,
-    enabled(props) {
-      if (props.currentProfile.createdAt) {
-        if (new Date(props.currentProfile.createdAt) < new Date('2024-10-09')) {
-          return true
-        }
-      }
-      return false
-    },
-  },
-]
+}[] = []
 
 const Context = React.createContext<Context>({
   activeNux: undefined,
@@ -66,7 +53,14 @@ export function NuxDialogs() {
   const onboardingActive = useOnboardingState().isActive
 
   const isLoading =
-    !currentAccount || !preferences || !profile || onboardingActive
+    onboardingActive ||
+    !currentAccount ||
+    !preferences ||
+    !profile ||
+    // Profile isn't legit ready until createdAt is a real date.
+    !profile.createdAt ||
+    profile.createdAt === '0001-01-01T00:00:00.000Z' // TODO: Fix this in AppView.
+
   return !isLoading ? (
     <Inner
       currentAccount={currentAccount}
@@ -174,7 +168,7 @@ function Inner({
 
   return (
     <Context.Provider value={ctx}>
-      {activeNux === Nux.NeueTypography && <NeueTypography />}
+      {/*For example, activeNux === Nux.NeueTypography && <NeueTypography />*/}
     </Context.Provider>
   )
 }