Skip to content

Commit 3d528bc

Browse files
vayungodaraclaude
andcommitted
fix: rename useStreakFreeze to applyStreakFreeze (lint error)
The 'use' prefix triggers React's hooks ESLint rule since it's called inside handleUseFreeze (not a component or hook). Rename to applyStreakFreeze everywhere and remove the alias export. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d99eeb1 commit 3d528bc

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

components/DailySummaryCard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useState, useEffect, useMemo } from 'react';
44
import { motion } from 'framer-motion';
55
import { createClient } from '@/lib/supabase/client';
66
import { fadeInUp, streakCelebration } from '@/lib/animations';
7-
import { checkStreakAtRisk, useStreakFreeze, getStreakFreezeStatus, FREEZE_COOLDOWN_DAYS } from '@/lib/streaks-advanced';
7+
import { checkStreakAtRisk, applyStreakFreeze, getStreakFreezeStatus, FREEZE_COOLDOWN_DAYS } from '@/lib/streaks-advanced';
88
import { useToast } from '@/components/Toast';
99
import styles from './DailySummaryCard.module.css';
1010

@@ -138,7 +138,7 @@ export default function DailySummaryCard({ userId, refreshKey }) {
138138

139139
const handleUseFreeze = async () => {
140140
setFreezeLoading(true);
141-
const result = await useStreakFreeze(supabase);
141+
const result = await applyStreakFreeze(supabase);
142142
setFreezeLoading(false);
143143

144144
if (result.success) {

lib/streaks-advanced.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export async function checkStreakAtRisk(supabase, userId) {
7272
*
7373
* On success: decrements pool, sets last_activity_date to today (saves streak).
7474
*/
75-
export { applyStreakFreeze as useStreakFreeze };
7675
export async function applyStreakFreeze(supabase) {
7776
try {
7877
const { data: authData } = await supabase.auth.getUser();

0 commit comments

Comments
 (0)