From 438b69b37111ad7de8778a8f4071fbfd65768d75 Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Wed, 16 Nov 2022 14:40:45 +0100 Subject: [PATCH] [FIX] Playing multiple voice messages at the same time (#4662) Co-authored-by: gitstart Co-authored-by: Debojyoti Singha <20729878+debojyoti452@users.noreply.github.com> Co-authored-by: Diego Mello --- app/containers/message/Audio.tsx | 12 ++++++++++++ app/containers/message/constants.ts | 1 + 2 files changed, 13 insertions(+) diff --git a/app/containers/message/Audio.tsx b/app/containers/message/Audio.tsx index 51d4b53c6..21737ca2f 100644 --- a/app/containers/message/Audio.tsx +++ b/app/containers/message/Audio.tsx @@ -20,6 +20,8 @@ import { TGetCustomEmoji } from '../../definitions/IEmoji'; import { IAttachment } from '../../definitions'; import { TSupportedThemes } from '../../theme'; import { downloadAudioFile } from '../../lib/methods/audioFile'; +import EventEmitter from '../../lib/methods/helpers/events'; +import { PAUSE_AUDIO } from './constants'; interface IButton { loading: boolean; @@ -128,6 +130,11 @@ class MessageAudio extends React.Component { + EventEmitter.removeListener(PAUSE_AUDIO, this.pauseSound); + this.togglePlayPause(); + }; + async componentDidMount() { const { file, messageId } = this.props; const { baseUrl, user } = this.context; @@ -183,6 +190,7 @@ class MessageAudio extends React.Component