Skip to content

Commit f01223e

Browse files
committed
NAVAND-1001: share lastPlayedInstructions between MapboxAudioGuidanceVoice instances
1 parent 15d044e commit f01223e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libnavui-voice/src/main/java/com/mapbox/navigation/ui/voice/api/MapboxAudioGuidance.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import kotlinx.coroutines.flow.filter
2727
import kotlinx.coroutines.flow.first
2828
import kotlinx.coroutines.flow.flatMapConcat
2929
import kotlinx.coroutines.flow.flatMapLatest
30+
import kotlinx.coroutines.flow.flatMapMerge
3031
import kotlinx.coroutines.flow.flowOf
3132
import kotlinx.coroutines.flow.map
3233
import kotlinx.coroutines.flow.updateAndGet
@@ -127,8 +128,8 @@ internal constructor(
127128
private fun audioGuidanceFlow(
128129
mapboxNavigation: MapboxNavigation
129130
): Flow<MapboxAudioGuidanceState> {
130-
return mapboxNavigation.audioGuidanceVoice().flatMapLatest { audioGuidance ->
131-
var lastPlayedInstructions: VoiceInstructions? = null
131+
var lastPlayedInstructions: VoiceInstructions? = null
132+
return mapboxNavigation.audioGuidanceVoice().flatMapMerge { audioGuidance ->
132133
mutedStateFlow.flatMapLatest { isMuted ->
133134
val voiceInstructions = mapboxVoiceInstructions.voiceInstructions()
134135
.map { state ->

0 commit comments

Comments
 (0)