File tree Expand file tree Collapse file tree
app/src/main/java/com/karrar/movieapp/ui/profile/myratings Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments