refactor: doesn't crash tab, and doesn't cause errors
This commit is contained in:
@@ -10,14 +10,16 @@ export class CourseSchedule {
|
|||||||
meetings: CourseMeeting[];
|
meetings: CourseMeeting[];
|
||||||
|
|
||||||
constructor(courseSchedule?: Serialized<CourseSchedule>) {
|
constructor(courseSchedule?: Serialized<CourseSchedule>) {
|
||||||
|
this.meetings = [];
|
||||||
if (!courseSchedule) {
|
if (!courseSchedule) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Object.assign(this, courseSchedule);
|
Object.assign(this, courseSchedule);
|
||||||
this.meetings = [];
|
let newMeetings = [];
|
||||||
for (let meeting of courseSchedule.meetings) {
|
for (let meeting of courseSchedule.meetings) {
|
||||||
this.meetings.push(new CourseMeeting(meeting));
|
newMeetings.push(new CourseMeeting(meeting));
|
||||||
}
|
}
|
||||||
|
this.meetings = newMeetings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user