Skip to content

Commit 4cae8b0

Browse files
Merge pull request #223 from Shanghai-Squad/refactor/#182-my-ratings-screen
fix: tv shows not displayed in my rating screen
2 parents ef162ee + da8bb74 commit 4cae8b0

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

app/src/main/java/com/karrar/movieapp/ui/profile/myratings/MyRatingsViewModel.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ class MyRatingsViewModel @Inject constructor(
104104

105105
fun onTabChanged(contentType: MyRateUIState.ContentType) {
106106
val mediaType = when (contentType) {
107-
MyRateUIState.ContentType.MOVIES -> MediaTypes.MOVIE
108-
MyRateUIState.ContentType.TV_SHOWS -> MediaTypes.TVS_SHOW
109-
}.toString()
107+
MyRateUIState.ContentType.MOVIES -> MOVIE
108+
MyRateUIState.ContentType.TV_SHOWS -> TV
109+
}
110110
_ratedUiState.update {
111111
val filtered = it.ratedList.filter { item -> item.mediaType == mediaType }
112112
it.copy(
@@ -140,4 +140,9 @@ class MyRatingsViewModel @Inject constructor(
140140
fun onClickStartRatings() {
141141
_myRatingUIEvent.update { Event(MyRatingUIEvent.StartRatingsEvent) }
142142
}
143+
144+
companion object {
145+
const val MOVIE = "movie"
146+
const val TV = "tv"
147+
}
143148
}

0 commit comments

Comments
 (0)