Skip to content

Commit 1d3ff89

Browse files
committed
fix: 통계 저장 후 스트릭 계산
1 parent 34734f6 commit 1d3ff89

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

services/heatmap/dailyStat.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ export const recomputeDailyStat = async (uid: string) => {
5050
/** 3. DailyStat 덮어쓰기 */
5151
const ref = doc(db, 'users', uid, 'dailyStats', dateKey);
5252

53-
/** 4. 연속 잔디 심기 일 수 계산 */
54-
const streakDays = await fetchStreakDays(uid);
55-
await updateDoc(doc(db, 'users', uid), { streakDays });
56-
5753
await setDoc(
5854
ref,
5955
{
@@ -65,6 +61,10 @@ export const recomputeDailyStat = async (uid: string) => {
6561
},
6662
{ merge: true }
6763
);
64+
65+
/** 4. 연속 잔디 심기 일 수 계산 */
66+
const streakDays = await fetchStreakDays(uid);
67+
await updateDoc(doc(db, 'users', uid), { streakDays });
6868
};
6969

7070
export const fetchDailyStats = async (uid: string): Promise<DailyStat[]> => {

0 commit comments

Comments
 (0)