desktop: fix voice message recording not stopping on chat switch (#6849)

This commit is contained in:
Narasimha-sc
2026-04-21 19:05:33 +01:00
committed by GitHub
parent 12e62aaba1
commit 607124079f
@@ -1304,6 +1304,8 @@ fun ComposeView(
composeState.value = cs.copy(inProgress = false, progressByTimeout = false)
} else if (!cs.empty) {
if (cs.preview is ComposePreview.VoicePreview && !cs.preview.finished) {
recState.value = RecordingState.NotStarted
RecorderInterface.stopRecording?.invoke()
composeState.value = cs.copy(preview = cs.preview.copy(finished = true))
}
if (saveLastDraft) {