File tree Expand file tree Collapse file tree
course/src/main/java/org/openedx/course/presentation/outline
dates/src/main/java/org/openedx/dates/presentation/dates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ import org.openedx.core.system.connection.NetworkConnection
3434import org.openedx.core.system.notifier.CalendarSyncEvent.CreateCalendarSyncEvent
3535import org.openedx.core.system.notifier.CourseDatesShifted
3636import org.openedx.core.system.notifier.CourseNotifier
37- import org.openedx.core.system.notifier.CourseOpenBlock
3837import org.openedx.core.system.notifier.CourseStructureUpdated
3938import org.openedx.course.domain.interactor.CourseInteractor
4039import org.openedx.course.presentation.CourseAnalytics
@@ -107,10 +106,6 @@ class CourseContentAllViewModel(
107106 getCourseData()
108107 }
109108 }
110-
111- is CourseOpenBlock -> {
112- _resumeBlockId .emit(event.blockId)
113- }
114109 }
115110 }
116111 }
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import androidx.compose.material.pullrefresh.pullRefresh
3030import androidx.compose.material.pullrefresh.rememberPullRefreshState
3131import androidx.compose.material.rememberScaffoldState
3232import androidx.compose.runtime.Composable
33+ import androidx.compose.runtime.LaunchedEffect
3334import androidx.compose.runtime.derivedStateOf
3435import androidx.compose.runtime.getValue
3536import androidx.compose.runtime.mutableStateOf
@@ -183,10 +184,12 @@ fun DatesScreen(
183184 val lastVisibleItemIndex =
184185 layoutInfo.visibleItemsInfo.lastOrNull()?.index ? : 0
185186 val totalItemsCount = layoutInfo.totalItemsCount
186- if ( totalItemsCount > 0 &&
187+ val shouldLoadMore = totalItemsCount > 0 &&
187188 lastVisibleItemIndex >= (totalItemsCount * LOAD_MORE_THRESHOLD ).toInt()
188- ) {
189- onAction(DatesViewActions .LoadMore )
189+ LaunchedEffect (shouldLoadMore) {
190+ if (shouldLoadMore) {
191+ onAction(DatesViewActions .LoadMore )
192+ }
190193 }
191194 }
192195 }
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ class DatesViewModel(
5858
5959 private var page = 1
6060 private var fetchDataJob: Job ? = null
61+ private var lastNavigationTime = 0L
6162
6263 init {
6364 preloadFirstPageCachedDates()
@@ -199,6 +200,11 @@ class DatesViewModel(
199200 fragmentManager : FragmentManager ,
200201 courseDate : CourseDate ,
201202 ) {
203+ val currentTime = System .currentTimeMillis()
204+ if (currentTime - lastNavigationTime < NAVIGATION_DEBOUNCE_MS ) {
205+ return
206+ }
207+ lastNavigationTime = currentTime
202208 logEvent(DatesAnalyticsEvent .ASSIGNMENT_CLICK )
203209 datesRouter.navigateToCourseOutline(
204210 fm = fragmentManager,
@@ -209,6 +215,10 @@ class DatesViewModel(
209215 )
210216 }
211217
218+ companion object {
219+ private const val NAVIGATION_DEBOUNCE_MS = 500L
220+ }
221+
212222 private fun groupCourseDates (dates : List <CourseDate >): Map <DatesSection , List <CourseDate >> {
213223 val now = Date ()
214224 val calendar = Calendar .getInstance().apply { time = now }
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ EXPERIMENTAL_FEATURES:
6868 APP_LEVEL_DOWNLOADS :
6969 ENABLED : false
7070 APP_LEVEL_DATES :
71- ENABLED : true
71+ ENABLED : false
7272
7373# Platform names
7474PLATFORM_NAME : " OpenEdX"
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ EXPERIMENTAL_FEATURES:
6868 APP_LEVEL_DOWNLOADS :
6969 ENABLED : false
7070 APP_LEVEL_DATES :
71- ENABLED : true
71+ ENABLED : false
7272
7373# Platform names
7474PLATFORM_NAME : " OpenEdX"
You can’t perform that action at this time.
0 commit comments