diff --git a/src/components/assignmentsPage/components/play/AssignmentMobilePage.tsx b/src/components/assignmentsPage/components/play/AssignmentMobilePage.tsx index 795a19ac8a..cfa9406f31 100644 --- a/src/components/assignmentsPage/components/play/AssignmentMobilePage.tsx +++ b/src/components/assignmentsPage/components/play/AssignmentMobilePage.tsx @@ -119,10 +119,6 @@ class AssignmentMobilePage extends Component { } return -1; }); - - if (classroom.assignments.length > 0) { - console.log('classroom1', classroom) - } } // sort return classrooms.filter(c => c.assignments.length > 0); @@ -132,8 +128,7 @@ class AssignmentMobilePage extends Component { const assignments = await getAssignedBricks(); const subjects = await getSubjects(); if (assignments && subjects) { - let classrooms = this.getClassrooms(assignments); - console.log('classrooms', classrooms) + const classrooms = this.getClassrooms(assignments); if (activeClassroomId > 0) { const classroom = classrooms.find(c => c.id === activeClassroomId); if (classroom) { diff --git a/src/components/viewAllPage/ViewAll.tsx b/src/components/viewAllPage/ViewAll.tsx index a83c0526bc..19ff388233 100644 --- a/src/components/viewAllPage/ViewAll.tsx +++ b/src/components/viewAllPage/ViewAll.tsx @@ -144,9 +144,7 @@ interface ViewAllState { const MobileTheme = React.lazy(() => import("./themes/ViewAllPageMobileTheme")); const TabletTheme = React.lazy(() => import("./themes/ViewAllPageTabletTheme")); -const DesktopTheme = React.lazy( - () => import("./themes/ViewAllPageDesktopTheme") -); +const DesktopTheme = React.lazy(() => import("./themes/ViewAllPageDesktopTheme")); class ViewAllPage extends Component { static animationTimeout = 600; @@ -271,7 +269,7 @@ class ViewAllPage extends Component { const oldNotifications = prevProps.notifications; if (notifications && oldNotifications) { if (notifications.length > oldNotifications.length) { - this.loadBricks(); + this.loadBricks(this.state.subjects); } } this.addWheelListener(); @@ -352,7 +350,7 @@ class ViewAllPage extends Component { } async loadData(values: queryString.ParsedQuery) { - await this.loadSubjects(values); + const subjects = await this.loadSubjects(values); if (values.searchString) { let page = 0; @@ -364,7 +362,7 @@ class ViewAllPage extends Component { if (this.state.subjectGroup) { this.loadUnauthorizedBricks(this.state.subjectGroup); } else { - this.loadBricks(values); + this.loadBricks(subjects, values); } } else { if (this.state.subjectGroup) { @@ -409,13 +407,17 @@ class ViewAllPage extends Component { ); } - async loadBricks(values?: queryString.ParsedQuery) { + async loadBricks(subjects: SubjectItem[] | null, values?: queryString.ParsedQuery) { if (this.props.user) { let subjectIds: number[] = []; const {state} = this; if (state.isAllSubjects == false) { subjectIds = this.props.user.subjects.map(s => s.id); + } else { + let checked = subjects?.filter(s => s.checked); + subjectIds = checked ? checked.map(s => s.id) : []; } + const pageBricks = await getPublishedBricksByPage( state.pageSize, state.page, true, state.filterLevels, state.filterLength, subjectIds,