fix conditions for newskie dialog

This commit is contained in:
Hailey
2024-06-14 16:32:15 -07:00
parent e20cd9c1cf
commit 988d41161c
2 changed files with 9 additions and 3 deletions
@@ -27,8 +27,6 @@ export function NewskieDialog({
const {joinedViaStarterPack} = profile const {joinedViaStarterPack} = profile
const profileName = profile.displayName || `@${profile.handle}` const profileName = profile.displayName || `@${profile.handle}`
if (!profile.createdAt) return null
return ( return (
<> <>
<Pressable <Pressable
+9 -1
View File
@@ -20,12 +20,20 @@ export function ProfileHeaderHandle({
const t = useTheme() const t = useTheme()
const invalidHandle = isInvalidHandle(profile.handle) const invalidHandle = isInvalidHandle(profile.handle)
const blockHide = profile.viewer?.blocking || profile.viewer?.blockedBy const blockHide = profile.viewer?.blocking || profile.viewer?.blockedBy
const createdAt = new Date(profile.createdAt).getTime()
const isNewskie = const isNewskie =
profile.createdAt && createdAt > 0 &&
Date.now() + 60e3 * 24 * DAYS_TO_SHOW_NEWSKIE > Date.now() + 60e3 * 24 * DAYS_TO_SHOW_NEWSKIE >
new Date(profile.createdAt).getTime() new Date(profile.createdAt).getTime()
console.log({
date: Date.now() + 60e3 * 24 * DAYS_TO_SHOW_NEWSKIE,
createdAt: new Date(profile.createdAt).getTime(),
})
console.log(isNewskie)
return ( return (
<View <View
style={[a.flex_row, a.gap_xs, a.align_center]} style={[a.flex_row, a.gap_xs, a.align_center]}