Skip to content

Commit

Permalink
fix: 비로그인 시 restore 안 되는 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
Gwak-Seungju committed Sep 26, 2024
1 parent e75e959 commit 0b234c1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/pages/TimetablePage/hooks/useTimetableV2Mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,16 @@ export default function useTimetableV2Mutation(frameId: number) {

const restoreLecture = () => {
const restoredLecture = JSON.parse(sessionStorage.getItem('restoreLecture')!);
mutateAddWithServer({
timetable_frame_id: frameId,
timetable_lecture: [
restoredLecture,
],
});
if ('name' in restoreLecture) {
addLectureFromLocalStorage(restoredLecture, semester);
} else {
mutateAddWithServer({
timetable_frame_id: frameId,
timetable_lecture: [
restoredLecture,
],
});
}
};

const removeMyLectureV2 = useMutation({
Expand Down

0 comments on commit 0b234c1

Please sign in to comment.