Merge pull request #1671 from vector-im/jonny/voice-message-fixes

Fix voice message preview player playing after delete/send
This commit is contained in:
jonnyandrew 2023-10-27 16:49:38 +01:00 committed by GitHub
commit b046493a7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 16 deletions

View file

@ -149,6 +149,7 @@ class VoiceMessageComposerPresenter @Inject constructor(
return@lambda
}
isSending = true
player.pause()
appCoroutineScope.sendMessage(
file = finishedState.file,
mimeType = finishedState.mimeType,
@ -165,7 +166,10 @@ class VoiceMessageComposerPresenter @Inject constructor(
is VoiceMessageComposerEvents.SendVoiceMessage -> localCoroutineScope.launch {
onSendButtonPress()
}
VoiceMessageComposerEvents.DeleteVoiceMessage -> localCoroutineScope.deleteRecording()
VoiceMessageComposerEvents.DeleteVoiceMessage -> {
player.pause()
localCoroutineScope.deleteRecording()
}
VoiceMessageComposerEvents.DismissPermissionsRationale -> onDismissPermissionsRationale()
VoiceMessageComposerEvents.AcceptPermissionRationale -> onAcceptPermissionsRationale()
is VoiceMessageComposerEvents.LifecycleEvent -> onLifecycleEvent(event.event)