Fix crash when recording long voice message.
This commit is contained in:
parent
da57eaadf2
commit
f3d7b16463
4 changed files with 10 additions and 4 deletions
|
|
@ -192,7 +192,10 @@ class DefaultVoiceMessageComposerPresenter(
|
|||
voiceMessageState = when (val state = recorderState) {
|
||||
is VoiceRecorderState.Recording -> VoiceMessageState.Recording(
|
||||
duration = state.elapsedTime,
|
||||
levels = state.levels.toImmutableList(),
|
||||
levels = state.levels
|
||||
// Keep only the last 128 samples for display, else we can have a crash
|
||||
.takeLast(128)
|
||||
.toImmutableList(),
|
||||
)
|
||||
is VoiceRecorderState.Finished ->
|
||||
previewState(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue