@elice/material-exercise 1.230222.0 → 1.230306.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,8 +44,8 @@ const ExerciseProvider = _a => {
44
44
  const exercise = recoil.useRecoilValue(recoil$1.exerciseState(materialExerciseId));
45
45
  const exerciseRoom = recoil.useRecoilValue(recoil$1.exerciseRoomState(exerciseRoomId)); // lecture
46
46
 
47
- const lecture = recoil.useRecoilValue(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId));
48
- const resetLecture = recoil.useResetRecoilState(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId)); // multilang languages
47
+ const lecture = recoil.useRecoilValue(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId));
48
+ const resetLecture = recoil.useResetRecoilState(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId)); // multilang languages
49
49
 
50
50
  const exerciseMultilangLanguages = recoil.useRecoilValue(recoil$1.exerciseMultilangLanguagesState(exercise === null || exercise === void 0 ? void 0 : exercise.id));
51
51
  const resetExerciseMultilangLanguages = recoil.useResetRecoilState(recoil$1.exerciseMultilangLanguagesState(exercise === null || exercise === void 0 ? void 0 : exercise.id)); // etc
@@ -83,7 +83,7 @@ const ExerciseProvider = _a => {
83
83
  //
84
84
 
85
85
  React__default["default"].useEffect(() => {
86
- if (!(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId)) {
86
+ if (!(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId)) {
87
87
  return;
88
88
  }
89
89
 
@@ -74,7 +74,17 @@ const exerciseState = recoil.atomFamily({
74
74
  const get = async () => {
75
75
  setSelf(await apiClient.getOrgMaterialExerciseGet({
76
76
  materialExerciseId
77
- }).then(res => res.materialExercise).catch(() => null));
77
+ }).then(res => res.materialExercise).then(materialExercise => Promise.all([materialExercise, apiClient.getOrgLecturePageResolve({
78
+ materialId: materialExercise.id,
79
+ materialType: types.enums.LectureMaterialType.Exercise
80
+ }).then(res => ({
81
+ _courseId: res.courseId,
82
+ _lectureId: res.lectureId,
83
+ _lecturePageId: res.lecturePageId,
84
+ _orderNo: res.orderNo
85
+ })).catch(err => {
86
+ throw err;
87
+ })])).then(([materialExercise, lecturePageResolve]) => Object.assign(Object.assign({}, materialExercise), lecturePageResolve)).catch(() => null));
78
88
  };
79
89
 
80
90
  if (trigger === 'get') {
@@ -10,7 +10,12 @@ export declare type AtomLectureState = GetOrgLectureGetResponses['lecture'] | nu
10
10
  /**
11
11
  * Material exercise.
12
12
  */
13
- export declare type AtomExerciseState = GetOrgMaterialExerciseGetResponses['materialExercise'] | null;
13
+ export declare type AtomExerciseState = (GetOrgMaterialExerciseGetResponses['materialExercise'] & {
14
+ _courseId: number;
15
+ _lectureId: number;
16
+ _lecturePageId: number;
17
+ _orderNo: number;
18
+ }) | null;
14
19
  /**
15
20
  * Material exercise room.
16
21
  */
@@ -53,7 +53,7 @@ const ExerciseFileEditor = () => {
53
53
  } = React__default["default"].useContext(context.ExerciseContext);
54
54
  const exercise = recoil.useRecoilValue(recoil$1.exerciseState(materialExerciseId));
55
55
  const exerciseRoom = recoil.useRecoilValue(recoil$1.exerciseRoomState(exerciseRoomId));
56
- const lecture = recoil.useRecoilValue(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId));
56
+ const lecture = recoil.useRecoilValue(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId));
57
57
  const preference = recoil.useRecoilValue(recoil$1.exerciseEditorPreferenceState);
58
58
  const activeFilename = recoil.useRecoilValue(recoil$1.exerciseActiveFilenameState);
59
59
  const readOnly = readOnlyEditor || readOnlyActiveFile;
@@ -27,7 +27,7 @@ const ExerciseMenuDropdown = () => {
27
27
  } = React__default["default"].useContext(context.ExerciseContext);
28
28
  const user = recoil.useRecoilValue(recoil$1.exerciseUserState);
29
29
  const exercise = recoil.useRecoilValue(recoil$1.exerciseState(materialExerciseId));
30
- const lecture = recoil.useRecoilValue(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId));
30
+ const lecture = recoil.useRecoilValue(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId));
31
31
  const activeFilename = recoil.useRecoilValue(recoil$1.exerciseActiveFilenameState);
32
32
  const setRightpaneActiveState = recoil.useSetRecoilState(recoil$1.exerciseRightpaneActiveState);
33
33
  const [isSubmitHistoryModalOpen, setIsSubmitHistoryModalOpen] = React__default["default"].useState(false);
@@ -34,7 +34,7 @@ const MaterialExerciseExerciseRoomDetail = ({
34
34
  goToList,
35
35
  onHide
36
36
  }) => {
37
- var _a, _b, _c, _d, _e, _f;
37
+ var _a, _b, _c, _d, _e;
38
38
 
39
39
  const intl = reactIntl.useIntl();
40
40
  const {
@@ -52,7 +52,7 @@ const MaterialExerciseExerciseRoomDetail = ({
52
52
  const [isLeaveDialogOpen, setIsLeaveDialogOpen] = React__default["default"].useState(false);
53
53
  const [isDeleting, setIsDeleting] = React__default["default"].useState(false);
54
54
  const isThisChatRoomOwner = (_b = ((_a = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.roomUsers.find(roomUser => roomUser.user.id === (user === null || user === void 0 ? void 0 : user.id))) === null || _a === void 0 ? void 0 : _a.permission) === types.enums.ExerciseRoomPermission.Owner) !== null && _b !== void 0 ? _b : false;
55
- const shareLink = materialExercise ? `https://${window.location.host}/courses/${materialExercise.courseId}/lectures/${materialExercise.lectureId}/materials/${(_c = materialExercise === null || materialExercise === void 0 ? void 0 : materialExercise.mainOrderNo) !== null && _c !== void 0 ? _c : 0}/projects/${selectedExerciseRoomId}` : '';
55
+ const shareLink = materialExercise ? `https://${window.location.host}/courses/${materialExercise._courseId}/lectures/${materialExercise === null || materialExercise === void 0 ? void 0 : materialExercise._lectureId}/materials/${materialExercise === null || materialExercise === void 0 ? void 0 : materialExercise._orderNo}/projects/${selectedExerciseRoomId}` : '';
56
56
  const [, copyToClipboard] = reactUse.useCopyToClipboard();
57
57
  const doGetOrgMaterialExerciseExerciseRoomGet = React__default["default"].useCallback(() => {
58
58
  return apiClient.getOrgMaterialExerciseExerciseRoomGet({
@@ -100,7 +100,7 @@ const MaterialExerciseExerciseRoomDetail = ({
100
100
  const doGetOrgCourseUserList = React__default["default"].useCallback(() => {
101
101
  if (materialExercise) {
102
102
  return apiClient.getOrgCourseUserList({
103
- courseId: materialExercise.courseId,
103
+ courseId: materialExercise._courseId,
104
104
  isForTutoring: false,
105
105
  count: 20,
106
106
  offset: 0,
@@ -174,7 +174,7 @@ const MaterialExerciseExerciseRoomDetail = ({
174
174
  return React__default["default"].createElement(StyledModal, {
175
175
  theme: "dark",
176
176
  onHide: onHide,
177
- title: (_d = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.title) !== null && _d !== void 0 ? _d : '',
177
+ title: (_c = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.title) !== null && _c !== void 0 ? _c : '',
178
178
  headerIcon: icons.eilArrowLeftwardsSingle,
179
179
  onHeaderIconClick: goToList,
180
180
  footerChild: exerciseRoom ? exerciseRoom.isDefaultRoom ? React__default["default"].createElement(blocks.Flex, {
@@ -217,7 +217,7 @@ const MaterialExerciseExerciseRoomDetail = ({
217
217
  label: intl.formatMessage({
218
218
  id: 'materialExerciseExerciseRoom.leave'
219
219
  }),
220
- disabled: (_e = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.isDefaultRoom) !== null && _e !== void 0 ? _e : false,
220
+ disabled: (_d = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.isDefaultRoom) !== null && _d !== void 0 ? _d : false,
221
221
  role: 'gray6',
222
222
  onClick: () => {
223
223
  setIsLeaveDialogOpen(true);
@@ -449,7 +449,7 @@ const MaterialExerciseExerciseRoomDetail = ({
449
449
  }), isThisChatRoomOwner ? React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(blocks.Select, {
450
450
  size: "small",
451
451
  width: "small",
452
- value: (_f = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.publicPermission) !== null && _f !== void 0 ? _f : types.enums.ExerciseRoomPermission.Nothing,
452
+ value: (_e = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.publicPermission) !== null && _e !== void 0 ? _e : types.enums.ExerciseRoomPermission.Nothing,
453
453
  onChange: value => {
454
454
  doPostOrgMaterialExerciseExerciseRoomEdit(value);
455
455
  },
@@ -59,7 +59,7 @@ const ExerciseRunnerControllerButtonGroup = () => {
59
59
  const exercise = recoil.useRecoilValue(recoil$1.exerciseState(materialExerciseId));
60
60
  const exerciseRunType = recoil.useRecoilValue(recoil$1.exerciseRunnerRunTypeState);
61
61
  const exerciseWithNoGrade = Boolean(exercise === null || exercise === void 0 ? void 0 : exercise.isNoSubmitGrade);
62
- const lecture = recoil.useRecoilValue(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId));
62
+ const lecture = recoil.useRecoilValue(recoil$1.exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId));
63
63
  const isTestLecture = (lecture === null || lecture === void 0 ? void 0 : lecture.lectureType) === types.enums.LectureType.Test;
64
64
  const isTestLectureCompleted = (lecture === null || lecture === void 0 ? void 0 : lecture.testAdmissionStatus) === types.enums.TestAdmissionStatus.Completed; // runner states
65
65
 
@@ -104,15 +104,19 @@ const ExerciseRunnerControllerRunningInfo = () => {
104
104
  //
105
105
 
106
106
  React__default["default"].useEffect(() => {
107
- if (exercise === null || exercise === void 0 ? void 0 : exercise.courseId) {
108
- apiClient.getOrgCourseGet({
109
- courseId: exercise.courseId
110
- }).then(({
111
- course
112
- }) => {
113
- setCourse(course);
114
- }).catch(console.error);
107
+ if (!exercise) {
108
+ return;
115
109
  }
110
+
111
+ const abortCtrl = new AbortController();
112
+ apiClient.getOrgCourseGet({
113
+ courseId: exercise._courseId
114
+ }, {
115
+ signal: abortCtrl.signal
116
+ }).then(res => res.course).then(setCourse).catch(console.error);
117
+ return () => {
118
+ abortCtrl.abort();
119
+ };
116
120
  }, [exercise]);
117
121
  /**
118
122
  * Last running score.
@@ -37,8 +37,8 @@ const ExerciseProvider = _a => {
37
37
  const exercise = useRecoilValue(exerciseState(materialExerciseId));
38
38
  const exerciseRoom = useRecoilValue(exerciseRoomState(exerciseRoomId)); // lecture
39
39
 
40
- const lecture = useRecoilValue(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId));
41
- const resetLecture = useResetRecoilState(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId)); // multilang languages
40
+ const lecture = useRecoilValue(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId));
41
+ const resetLecture = useResetRecoilState(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId)); // multilang languages
42
42
 
43
43
  const exerciseMultilangLanguages = useRecoilValue(exerciseMultilangLanguagesState(exercise === null || exercise === void 0 ? void 0 : exercise.id));
44
44
  const resetExerciseMultilangLanguages = useResetRecoilState(exerciseMultilangLanguagesState(exercise === null || exercise === void 0 ? void 0 : exercise.id)); // etc
@@ -76,7 +76,7 @@ const ExerciseProvider = _a => {
76
76
  //
77
77
 
78
78
  React.useEffect(() => {
79
- if (!(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId)) {
79
+ if (!(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId)) {
80
80
  return;
81
81
  }
82
82
 
@@ -1,4 +1,4 @@
1
- import { postGlobalAccountPreferenceEdit, postOrgMaterialExerciseExerciseRoomUserFileAdd, getOrgLectureGet, getOrgMaterialExerciseGet, getOrgMaterialExerciseExerciseRoomGet, getOrgUserGet, getGlobalAccountPreferenceGet, getOrgMaterialExerciseExerciseImageExerciseFileGet, getOrgMaterialExerciseExerciseRoomUserFileGet } from '@elice/api-client';
1
+ import { postGlobalAccountPreferenceEdit, postOrgMaterialExerciseExerciseRoomUserFileAdd, getOrgLectureGet, getOrgMaterialExerciseGet, getOrgLecturePageResolve, getOrgMaterialExerciseExerciseRoomGet, getOrgUserGet, getGlobalAccountPreferenceGet, getOrgMaterialExerciseExerciseImageExerciseFileGet, getOrgMaterialExerciseExerciseRoomUserFileGet } from '@elice/api-client';
2
2
  import { enums } from '@elice/types';
3
3
  import { EliceWebSocket } from '@elice/websocket';
4
4
  import { camelizeKeys } from 'humps';
@@ -66,7 +66,17 @@ const exerciseState = atomFamily({
66
66
  const get = async () => {
67
67
  setSelf(await getOrgMaterialExerciseGet({
68
68
  materialExerciseId
69
- }).then(res => res.materialExercise).catch(() => null));
69
+ }).then(res => res.materialExercise).then(materialExercise => Promise.all([materialExercise, getOrgLecturePageResolve({
70
+ materialId: materialExercise.id,
71
+ materialType: enums.LectureMaterialType.Exercise
72
+ }).then(res => ({
73
+ _courseId: res.courseId,
74
+ _lectureId: res.lectureId,
75
+ _lecturePageId: res.lecturePageId,
76
+ _orderNo: res.orderNo
77
+ })).catch(err => {
78
+ throw err;
79
+ })])).then(([materialExercise, lecturePageResolve]) => Object.assign(Object.assign({}, materialExercise), lecturePageResolve)).catch(() => null));
70
80
  };
71
81
 
72
82
  if (trigger === 'get') {
@@ -10,7 +10,12 @@ export declare type AtomLectureState = GetOrgLectureGetResponses['lecture'] | nu
10
10
  /**
11
11
  * Material exercise.
12
12
  */
13
- export declare type AtomExerciseState = GetOrgMaterialExerciseGetResponses['materialExercise'] | null;
13
+ export declare type AtomExerciseState = (GetOrgMaterialExerciseGetResponses['materialExercise'] & {
14
+ _courseId: number;
15
+ _lectureId: number;
16
+ _lecturePageId: number;
17
+ _orderNo: number;
18
+ }) | null;
14
19
  /**
15
20
  * Material exercise room.
16
21
  */
@@ -47,7 +47,7 @@ const ExerciseFileEditor = () => {
47
47
  } = React.useContext(ExerciseContext);
48
48
  const exercise = useRecoilValue(exerciseState(materialExerciseId));
49
49
  const exerciseRoom = useRecoilValue(exerciseRoomState(exerciseRoomId));
50
- const lecture = useRecoilValue(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId));
50
+ const lecture = useRecoilValue(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId));
51
51
  const preference = useRecoilValue(exerciseEditorPreferenceState);
52
52
  const activeFilename = useRecoilValue(exerciseActiveFilenameState);
53
53
  const readOnly = readOnlyEditor || readOnlyActiveFile;
@@ -21,7 +21,7 @@ const ExerciseMenuDropdown = () => {
21
21
  } = React.useContext(ExerciseContext);
22
22
  const user = useRecoilValue(exerciseUserState);
23
23
  const exercise = useRecoilValue(exerciseState(materialExerciseId));
24
- const lecture = useRecoilValue(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId));
24
+ const lecture = useRecoilValue(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId));
25
25
  const activeFilename = useRecoilValue(exerciseActiveFilenameState);
26
26
  const setRightpaneActiveState = useSetRecoilState(exerciseRightpaneActiveState);
27
27
  const [isSubmitHistoryModalOpen, setIsSubmitHistoryModalOpen] = React.useState(false);
@@ -26,7 +26,7 @@ const MaterialExerciseExerciseRoomDetail = ({
26
26
  goToList,
27
27
  onHide
28
28
  }) => {
29
- var _a, _b, _c, _d, _e, _f;
29
+ var _a, _b, _c, _d, _e;
30
30
 
31
31
  const intl = useIntl();
32
32
  const {
@@ -44,7 +44,7 @@ const MaterialExerciseExerciseRoomDetail = ({
44
44
  const [isLeaveDialogOpen, setIsLeaveDialogOpen] = React.useState(false);
45
45
  const [isDeleting, setIsDeleting] = React.useState(false);
46
46
  const isThisChatRoomOwner = (_b = ((_a = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.roomUsers.find(roomUser => roomUser.user.id === (user === null || user === void 0 ? void 0 : user.id))) === null || _a === void 0 ? void 0 : _a.permission) === enums.ExerciseRoomPermission.Owner) !== null && _b !== void 0 ? _b : false;
47
- const shareLink = materialExercise ? `https://${window.location.host}/courses/${materialExercise.courseId}/lectures/${materialExercise.lectureId}/materials/${(_c = materialExercise === null || materialExercise === void 0 ? void 0 : materialExercise.mainOrderNo) !== null && _c !== void 0 ? _c : 0}/projects/${selectedExerciseRoomId}` : '';
47
+ const shareLink = materialExercise ? `https://${window.location.host}/courses/${materialExercise._courseId}/lectures/${materialExercise === null || materialExercise === void 0 ? void 0 : materialExercise._lectureId}/materials/${materialExercise === null || materialExercise === void 0 ? void 0 : materialExercise._orderNo}/projects/${selectedExerciseRoomId}` : '';
48
48
  const [, copyToClipboard] = useCopyToClipboard();
49
49
  const doGetOrgMaterialExerciseExerciseRoomGet = React.useCallback(() => {
50
50
  return getOrgMaterialExerciseExerciseRoomGet({
@@ -92,7 +92,7 @@ const MaterialExerciseExerciseRoomDetail = ({
92
92
  const doGetOrgCourseUserList = React.useCallback(() => {
93
93
  if (materialExercise) {
94
94
  return getOrgCourseUserList({
95
- courseId: materialExercise.courseId,
95
+ courseId: materialExercise._courseId,
96
96
  isForTutoring: false,
97
97
  count: 20,
98
98
  offset: 0,
@@ -166,7 +166,7 @@ const MaterialExerciseExerciseRoomDetail = ({
166
166
  return React.createElement(StyledModal, {
167
167
  theme: "dark",
168
168
  onHide: onHide,
169
- title: (_d = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.title) !== null && _d !== void 0 ? _d : '',
169
+ title: (_c = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.title) !== null && _c !== void 0 ? _c : '',
170
170
  headerIcon: eilArrowLeftwardsSingle,
171
171
  onHeaderIconClick: goToList,
172
172
  footerChild: exerciseRoom ? exerciseRoom.isDefaultRoom ? React.createElement(Flex, {
@@ -209,7 +209,7 @@ const MaterialExerciseExerciseRoomDetail = ({
209
209
  label: intl.formatMessage({
210
210
  id: 'materialExerciseExerciseRoom.leave'
211
211
  }),
212
- disabled: (_e = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.isDefaultRoom) !== null && _e !== void 0 ? _e : false,
212
+ disabled: (_d = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.isDefaultRoom) !== null && _d !== void 0 ? _d : false,
213
213
  role: 'gray6',
214
214
  onClick: () => {
215
215
  setIsLeaveDialogOpen(true);
@@ -441,7 +441,7 @@ const MaterialExerciseExerciseRoomDetail = ({
441
441
  }), isThisChatRoomOwner ? React.createElement(React.Fragment, null, React.createElement(Select, {
442
442
  size: "small",
443
443
  width: "small",
444
- value: (_f = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.publicPermission) !== null && _f !== void 0 ? _f : enums.ExerciseRoomPermission.Nothing,
444
+ value: (_e = exerciseRoom === null || exerciseRoom === void 0 ? void 0 : exerciseRoom.publicPermission) !== null && _e !== void 0 ? _e : enums.ExerciseRoomPermission.Nothing,
445
445
  onChange: value => {
446
446
  doPostOrgMaterialExerciseExerciseRoomEdit(value);
447
447
  },
@@ -52,7 +52,7 @@ const ExerciseRunnerControllerButtonGroup = () => {
52
52
  const exercise = useRecoilValue(exerciseState(materialExerciseId));
53
53
  const exerciseRunType = useRecoilValue(exerciseRunnerRunTypeState);
54
54
  const exerciseWithNoGrade = Boolean(exercise === null || exercise === void 0 ? void 0 : exercise.isNoSubmitGrade);
55
- const lecture = useRecoilValue(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise.lectureId));
55
+ const lecture = useRecoilValue(exerciseLectureState(exercise === null || exercise === void 0 ? void 0 : exercise._lectureId));
56
56
  const isTestLecture = (lecture === null || lecture === void 0 ? void 0 : lecture.lectureType) === enums.LectureType.Test;
57
57
  const isTestLectureCompleted = (lecture === null || lecture === void 0 ? void 0 : lecture.testAdmissionStatus) === enums.TestAdmissionStatus.Completed; // runner states
58
58
 
@@ -97,15 +97,19 @@ const ExerciseRunnerControllerRunningInfo = () => {
97
97
  //
98
98
 
99
99
  React.useEffect(() => {
100
- if (exercise === null || exercise === void 0 ? void 0 : exercise.courseId) {
101
- getOrgCourseGet({
102
- courseId: exercise.courseId
103
- }).then(({
104
- course
105
- }) => {
106
- setCourse(course);
107
- }).catch(console.error);
100
+ if (!exercise) {
101
+ return;
108
102
  }
103
+
104
+ const abortCtrl = new AbortController();
105
+ getOrgCourseGet({
106
+ courseId: exercise._courseId
107
+ }, {
108
+ signal: abortCtrl.signal
109
+ }).then(res => res.course).then(setCourse).catch(console.error);
110
+ return () => {
111
+ abortCtrl.abort();
112
+ };
109
113
  }, [exercise]);
110
114
  /**
111
115
  * Last running score.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-exercise",
3
- "version": "1.230222.0",
3
+ "version": "1.230306.0",
4
4
  "description": "User view and editing components of Elice material exercise",
5
5
  "repository": "https://git.elicer.io/elice/frontend/library/elice-material",
6
6
  "license": "UNLICENSED",
@@ -29,14 +29,14 @@
29
29
  "clean": "del-cli \"es/*\" \"cjs/*\" \"dist/*\""
30
30
  },
31
31
  "peerDependencies": {
32
- "@elice/api-client": "1.230215.1",
32
+ "@elice/api-client": "^1.230306.0",
33
33
  "@elice/blocks": "^1.220803.0",
34
34
  "@elice/design-tokens": "^1.220803.0",
35
35
  "@elice/icons": "^1.220803.0",
36
36
  "@elice/markdown": "^1.220803.0",
37
37
  "@elice/material-shared-types": "*",
38
38
  "@elice/material-shared-utils": "*",
39
- "@elice/types": "1.230215.1",
39
+ "@elice/types": "^1.230306.0",
40
40
  "@elice/websocket": "^1.220803.0",
41
41
  "humps": "^2.0.1",
42
42
  "lodash": "^4.17.21",
@@ -74,14 +74,14 @@
74
74
  "xterm-addon-fit": "^0.5.0"
75
75
  },
76
76
  "devDependencies": {
77
- "@elice/api-client": "1.230215.1",
77
+ "@elice/api-client": "^1.230306.0",
78
78
  "@elice/blocks": "^1.220803.0",
79
79
  "@elice/design-tokens": "^1.220803.0",
80
80
  "@elice/icons": "^1.220803.0",
81
81
  "@elice/markdown": "^1.220803.0",
82
- "@elice/material-shared-types": "1.230222.0",
83
- "@elice/material-shared-utils": "1.230222.0",
84
- "@elice/types": "1.230215.1",
82
+ "@elice/material-shared-types": "1.230306.0",
83
+ "@elice/material-shared-utils": "1.230306.0",
84
+ "@elice/types": "^1.230306.0",
85
85
  "@elice/websocket": "^1.220803.0",
86
86
  "@types/classnames": "^2.3.1",
87
87
  "@types/color": "^3.0.3",
@@ -102,5 +102,5 @@
102
102
  "recoil": "^0.6.1",
103
103
  "styled-components": "^5.2.0"
104
104
  },
105
- "gitHead": "31176c73215066ca4d6760b8c8fde4e49fcba2ec"
105
+ "gitHead": "2ba30b7324d9fd782970a0343a6573827159b737"
106
106
  }