Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
fix: Hide components with student_view_multi_device set to false
Browse files Browse the repository at this point in the history
Fixes: LEARNER-9671
  • Loading branch information
HamzaIsrar12 committed Nov 7, 2023
1 parent c4e2dba commit 47ff82e
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,20 @@ class CourseUnitPagerAdapter(
CourseUnitDiscussionFragment.newInstance(minifiedUnit, courseData)
}

minifiedUnit is HtmlBlockModel -> {
minifiedUnit.setCourseId(courseData.course.id)
CourseUnitWebViewFragment.newInstance(minifiedUnit, courseData)
minifiedUnit.isMultiDevice.not() -> {
CourseUnitMobileNotSupportedFragment.newInstance(minifiedUnit, courseData)

Check warning on line 104 in OpenEdXMobile/src/main/java/org/edx/mobile/view/adapters/CourseUnitPagerAdapter.kt

View check run for this annotation

Codecov / codecov/patch

OpenEdXMobile/src/main/java/org/edx/mobile/view/adapters/CourseUnitPagerAdapter.kt#L104

Added line #L104 was not covered by tests
}

minifiedUnit.isEmptyComponent -> {
CourseUnitEmptyFragment.newInstance(minifiedUnit)
}

minifiedUnit is HtmlBlockModel -> {
minifiedUnit.setCourseId(courseData.course.id)
CourseUnitWebViewFragment.newInstance(minifiedUnit, courseData)

Check warning on line 113 in OpenEdXMobile/src/main/java/org/edx/mobile/view/adapters/CourseUnitPagerAdapter.kt

View check run for this annotation

Codecov / codecov/patch

OpenEdXMobile/src/main/java/org/edx/mobile/view/adapters/CourseUnitPagerAdapter.kt#L112-L113

Added lines #L112 - L113 were not covered by tests
}

else -> {
// in case of !minifiedUnit.isMultiDevice else executed
CourseUnitMobileNotSupportedFragment.newInstance(minifiedUnit, courseData)
}
}
Expand Down

0 comments on commit 47ff82e

Please sign in to comment.