fix: dashboard purgeNonMath 삭제 + API 에러 방어
- purgeNonMath 호출 제거 (데이터 삭제 위험) - Promise.all 내 비핵심 API에 .catch() 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -97,15 +97,6 @@ function DashboardBody() {
|
|||||||
setCoachDismissed(window.localStorage.getItem(COACH_DISMISS_KEY) === '1');
|
setCoachDismissed(window.localStorage.getItem(COACH_DISMISS_KEY) === '1');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const purged = localStorage.getItem('reloop-purged-non-math');
|
|
||||||
if (!purged) {
|
|
||||||
api.post('/study-logs/purge-non-math').then(() => {
|
|
||||||
localStorage.setItem('reloop-purged-non-math', 'true');
|
|
||||||
}).catch(() => {});
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
|
|
||||||
@@ -117,12 +108,12 @@ function DashboardBody() {
|
|||||||
const [meRes, summaryRes, recentRes, activityRes, subjectsRes, orgsRes, classesRes, assignmentsRes, calendarRes] = await Promise.all([
|
const [meRes, summaryRes, recentRes, activityRes, subjectsRes, orgsRes, classesRes, assignmentsRes, calendarRes] = await Promise.all([
|
||||||
api.get<MeUser>('/auth/me'),
|
api.get<MeUser>('/auth/me'),
|
||||||
api.get<DashboardSummary>('/dashboard/summary'),
|
api.get<DashboardSummary>('/dashboard/summary'),
|
||||||
api.get<StudyLog[]>('/study-logs', { params: { limit: 5 } }),
|
api.get<StudyLog[]>('/study-logs', { params: { limit: 5 } }).catch(() => ({ data: [] as StudyLog[] })),
|
||||||
api.get<StudyLog[]>('/study-logs', { params: { limit: 200 } }),
|
api.get<StudyLog[]>('/study-logs', { params: { limit: 200 } }).catch(() => ({ data: [] as StudyLog[] })),
|
||||||
api.get<SubjectStats[]>('/stats/subjects'),
|
api.get<SubjectStats[]>('/stats/subjects').catch(() => ({ data: [] as SubjectStats[] })),
|
||||||
getMyOrganizations(),
|
getMyOrganizations().catch(() => [] as Organization[]),
|
||||||
getMyClasses(),
|
getMyClasses().catch(() => [] as Awaited<ReturnType<typeof getMyClasses>>),
|
||||||
getAssignments(),
|
getAssignments().catch(() => [] as Awaited<ReturnType<typeof getAssignments>>),
|
||||||
getReviewCalendar(now.getFullYear(), now.getMonth() + 1).catch(() => ({ days: [] as CalendarDay[] })),
|
getReviewCalendar(now.getFullYear(), now.getMonth() + 1).catch(() => ({ days: [] as CalendarDay[] })),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user