Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Walkthrough회의별 계산 상태를 추적하기 위해 단순한 id 기반 로직을 localStorage 기반의 지속 플래그로 변경했습니다. calculationType은 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/meeting/[id]/page.tsx (1)
177-181: 스토리지 접근을 공통 유틸로 통일해 주세요.Line 177-181에서
localStorage를 직접 다루고 있는데, 같은 파일은 이미lib/storage.ts(Line 1-27)의 추상화(getMeetingUserId,removeMeetingUserId)를 사용 중입니다. 키 네이밍/SSR 가드가 분산되면 추후 정리나 확장 시 누락 위험이 커집니다.midpoint플래그도 storage 유틸로 올려 일관화하는 쪽을 권장합니다.♻️ 제안 코드
- import { getMeetingUserId, removeMeetingUserId } from '@/lib/storage'; + import { + getMeetingUserId, + removeMeetingUserId, + getMidpointCalculated, + setMidpointCalculated, + } from '@/lib/storage'; ... - const alreadyCalculated = localStorage.getItem(`midpoint_calculated_${id}`) === '1'; + const alreadyCalculated = getMidpointCalculated(id); const calculationType = alreadyCalculated ? 'recalculated' : 'first'; if (!alreadyCalculated) { - localStorage.setItem(`midpoint_calculated_${id}`, '1'); + setMidpointCalculated(id, true); }// lib/storage.ts export const getMidpointCalculated = (meetingId: string): boolean => { if (typeof window === 'undefined') return false; return localStorage.getItem(`meeting_${meetingId}_midpoint_calculated`) === '1'; }; export const setMidpointCalculated = (meetingId: string, calculated: boolean) => { if (typeof window === 'undefined') return; localStorage.setItem(`meeting_${meetingId}_midpoint_calculated`, calculated ? '1' : '0'); };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/meeting/`[id]/page.tsx around lines 177 - 181, Replace the direct localStorage access in page.tsx with new storage helpers: add getMidpointCalculated(meetingId: string): boolean and setMidpointCalculated(meetingId: string, calculated: boolean) to lib/storage.ts (these should include the SSR guard and use a consistent key like meeting_{id}_midpoint_calculated), then in the component replace the current alreadyCalculated / localStorage.setItem logic by calling getMidpointCalculated(id) and setMidpointCalculated(id, true) (or false as needed) so key naming and SSR checks are centralized in getMidpointCalculated/setMidpointCalculated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/meeting/`[id]/page.tsx:
- Around line 177-181: Replace the direct localStorage access in page.tsx with
new storage helpers: add getMidpointCalculated(meetingId: string): boolean and
setMidpointCalculated(meetingId: string, calculated: boolean) to lib/storage.ts
(these should include the SSR guard and use a consistent key like
meeting_{id}_midpoint_calculated), then in the component replace the current
alreadyCalculated / localStorage.setItem logic by calling
getMidpointCalculated(id) and setMidpointCalculated(id, true) (or false as
needed) so key naming and SSR checks are centralized in
getMidpointCalculated/setMidpointCalculated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: eb55beed-ae26-453c-a345-f7099d5b47bc
📒 Files selected for processing (1)
app/meeting/[id]/page.tsx
🚀 중간지점 조회 데이터 값 문제 수정
📝 변경사항
midpoint_calculated_${id}를 가지고 첫 진입시 first 아닐경우 recalculated✅ 체크리스트
📸 스크린샷
💬 리뷰어 전달사항
Summary by CodeRabbit
릴리스 노트
새 기능
버그 수정