flatMap with runCatching is more appropriate here.
This commit is contained in:
parent
f5c776ac9c
commit
900074ee20
1 changed files with 3 additions and 2 deletions
|
|
@ -27,6 +27,7 @@ import io.element.android.features.messages.impl.voicemessages.VoiceMessageExcep
|
|||
import io.element.android.libraries.architecture.AsyncData
|
||||
import io.element.android.libraries.architecture.Presenter
|
||||
import io.element.android.libraries.architecture.runUpdatingState
|
||||
import io.element.android.libraries.core.extensions.flatMap
|
||||
import io.element.android.libraries.di.RoomScope
|
||||
import io.element.android.libraries.ui.utils.time.formatShort
|
||||
import io.element.android.services.analytics.api.AnalyticsService
|
||||
|
|
@ -126,8 +127,8 @@ class VoiceMessagePresenter @AssistedInject constructor(
|
|||
it
|
||||
},
|
||||
) {
|
||||
player.prepare().apply {
|
||||
player.play()
|
||||
player.prepare().flatMap {
|
||||
runCatching { player.play() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue