File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
app/src/main/java/com/runnect/runnect/presentation/discover Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ class DiscoverViewModel @Inject constructor(
9191
9292 private fun getMarathonCourse () {
9393 viewModelScope.launch {
94+ _marathonCourseState .value = UiStateV2 .Loading
95+
9496 courseRepository.getMarathonCourse()
9597 .onSuccess { courses ->
9698 if (courses == null ) {
@@ -113,6 +115,8 @@ class DiscoverViewModel @Inject constructor(
113115
114116 fun getRecommendCourse (pageNo : Int , ordering : String ) {
115117 viewModelScope.launch {
118+ _recommendCourseState .value = UiStateV2 .Loading
119+
116120 courseRepository.getRecommendCourse(pageNo = pageNo.toString(), ordering = ordering)
117121 .onSuccess { courses ->
118122 if (courses == null ) {
@@ -125,6 +129,7 @@ class DiscoverViewModel @Inject constructor(
125129 _multiViewItems .add(courses)
126130 _recommendCourseState .value = UiStateV2 .Success (courses)
127131 Timber .e(" RECOMMEND COURSE GET SUCCESS" )
132+ Timber .e(" ITEM SIZE: ${multiViewItems.size} " )
128133 }.onFailure { exception ->
129134 _recommendCourseState .value = UiStateV2 .Failure (exception.message.toString())
130135 Timber .e(" RECOMMEND COURSE GET FAIL" )
You can’t perform that action at this time.
0 commit comments