diff --git a/frontend/src/pages/curriculum/CurriculumPage.js b/frontend/src/pages/curriculum/CurriculumPage.js index d7dc328..a1a7e8c 100644 --- a/frontend/src/pages/curriculum/CurriculumPage.js +++ b/frontend/src/pages/curriculum/CurriculumPage.js @@ -318,18 +318,18 @@ function SessionForm({ day, week, onClose, onSave }) { // ── 메인 컴포넌트 ───────────────────────────────────── function CurriculumPage() { - const [role, setRole] = useState(localStorage.getItem('role') || 'MEMBER'); + const [role, setRole] = useState(null); const [days, setDays] = useState([]); const [showForm, setShowForm] = useState(false); const [editDay, setEditDay] = useState(null); const [createWeek, setCreateWeek] = useState(null); useEffect(() => { - const handleStorage = () => setRole(localStorage.getItem('role') || 'MEMBER'); - window.addEventListener('storage', handleStorage); - return () => window.removeEventListener('storage', handleStorage); + setRole(localStorage.getItem('role') || 'MEMBER'); }, []); + // if (role === null) return null; + const fetchDays = async () => { try { const res = await authFetch('/api/curriculums');