diff --git a/packages/shared/src/components/streak/ReadingStreakButton.tsx b/packages/shared/src/components/streak/ReadingStreakButton.tsx index f231698918..d3e7f2d8e5 100644 --- a/packages/shared/src/components/streak/ReadingStreakButton.tsx +++ b/packages/shared/src/components/streak/ReadingStreakButton.tsx @@ -75,7 +75,8 @@ export function ReadingStreakButton({ const isMobile = useViewSize(ViewSize.MobileL); const [shouldShowStreaks, setShouldShowStreaks] = useState(false); const hasReadToday = - new Date(streak?.lastViewAt).getDate() === new Date().getDate(); + streak?.lastViewAtTz && + new Date(streak.lastViewAtTz).getDate() === new Date().getDate(); const handleToggle = useCallback(() => { setShouldShowStreaks((state) => !state); diff --git a/packages/shared/src/graphql/fragments.ts b/packages/shared/src/graphql/fragments.ts index 8c1679c628..e692207217 100644 --- a/packages/shared/src/graphql/fragments.ts +++ b/packages/shared/src/graphql/fragments.ts @@ -332,6 +332,7 @@ export const USER_STREAK_FRAGMENT = gql` total current lastViewAt + lastViewAtTz weekStart } `; diff --git a/packages/shared/src/graphql/users.ts b/packages/shared/src/graphql/users.ts index dda9d0c4ab..61d78437d7 100644 --- a/packages/shared/src/graphql/users.ts +++ b/packages/shared/src/graphql/users.ts @@ -498,6 +498,7 @@ export interface UserStreak { current: number; weekStart: DayOfWeek; lastViewAt: Date; + lastViewAtTz: Date; } export const getReadingStreak = async (): Promise => {