Skip to content

Commit 0193b58

Browse files
committed
fix: firestore streakStart is now streakStartDate
1 parent 04badde commit 0193b58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/firebase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export const register = async (email: string, password: string, username: string
154154
role: 'member', // Default role
155155
joinedAt: Timestamp.now(),
156156
streakDays: 0,
157-
streakStart: Timestamp.now(),
157+
streakStartDate: Timestamp.now(),
158158
lastCheckIn: Timestamp.now()
159159
});
160160

@@ -327,7 +327,7 @@ export const updateStreakStart = async (userId: string, startDate: Date) => {
327327

328328
await updateDoc(userRef, {
329329
streakDays: diffInDays > 0 ? diffInDays : 0, // Ensure streakDays is not negative
330-
streakStart: Timestamp.fromDate(startDate)
330+
streakStartDate: Timestamp.fromDate(startDate)
331331
});
332332

333333
return { success: true, message: 'Streak start updated successfully' };

0 commit comments

Comments
 (0)