clarifying why we do nothing when the state is locked on voice recording ended
This commit is contained in:
parent
16ca7d5040
commit
4dbb150ac2
|
@ -709,10 +709,16 @@ class RoomDetailFragment @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onVoiceRecordingEnded(lastKnownState: RecordingUiState?) {
|
||||
if (lastKnownState != RecordingUiState.Locked) {
|
||||
val isCancelled = lastKnownState == RecordingUiState.Cancelled
|
||||
roomDetailViewModel.handle(RoomDetailAction.EndRecordingVoiceMessage(isCancelled = isCancelled))
|
||||
updateRecordingUiState(RecordingUiState.None)
|
||||
when (lastKnownState) {
|
||||
RecordingUiState.Locked -> {
|
||||
// do nothing,
|
||||
// onSendVoiceMessage, onDeleteVoiceMessage or onRecordingLimitReached will be triggered instead
|
||||
}
|
||||
else -> {
|
||||
val isCancelled = lastKnownState == RecordingUiState.Cancelled
|
||||
roomDetailViewModel.handle(RoomDetailAction.EndRecordingVoiceMessage(isCancelled = isCancelled))
|
||||
updateRecordingUiState(RecordingUiState.None)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue