Skip to content

Commit 471eb1e

Browse files
fix: resolve ESLint error - move ref assignment out of render
- Move scheduleRef.current assignment into useEffect to avoid "Cannot access refs during render" error - Remove unused Timestamp import and stale eslint-disable comment in dream-gym admin service Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 06e89bd commit 471eb1e

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/app/dashboard/dream-gym/schedule/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export default function SchedulePage() {
6262
const scheduleRef = useRef<WeekSchedule>({});
6363

6464
// Keep ref in sync with state for use in debounced save
65-
scheduleRef.current = schedule;
65+
useEffect(() => {
66+
scheduleRef.current = schedule;
67+
});
6668

6769
// Load players on mount
6870
useEffect(() => {

src/lib/firebase/admin-services/dream-gym.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import { adminDb } from '../admin';
11-
import { Timestamp } from 'firebase-admin/firestore';
11+
1212
import type {
1313
DreamGym,
1414
DreamGymDocument,
@@ -62,7 +62,6 @@ function toDreamGym(id: string, data: DreamGymDocument): DreamGym {
6262
export async function getDreamGymAdmin(
6363
userId: string,
6464
playerId: string
65-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6665
): Promise<(DreamGym & { weeklyGrid?: Record<string, Record<string, string | null>> }) | null> {
6766
const docRef = adminDb.doc(`users/${userId}/players/${playerId}/dreamGym/${DREAM_GYM_DOC_ID}`);
6867
const docSnap = await docRef.get();

0 commit comments

Comments
 (0)