Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ashiagr committed May 24, 2023
1 parent 270708f commit bd5a809
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filterIsInstance
Expand Down Expand Up @@ -104,8 +105,10 @@ class EpisodeViewModel @Inject constructor(
)

val stateFlow: StateFlow<State>
var showNowPlaying = MutableSharedFlow<Boolean>()
private set

// SharedFlow used for one shot operation like navigating to the Now Playing screen
private val _showNowPlaying = MutableSharedFlow<Boolean>()
val showNowPlaying = _showNowPlaying.asSharedFlow()

init {
val episodeUuid = savedStateHandle.get<String>(EpisodeScreenFlow.episodeUuidArgument)
Expand Down Expand Up @@ -262,7 +265,7 @@ class EpisodeViewModel @Inject constructor(
episode = episode,
playbackSource = analyticsSource,
)
showNowPlaying.emit(true)
_showNowPlaying.emit(true)
}
}

Expand Down

0 comments on commit bd5a809

Please sign in to comment.