Fix voice messages with multiple composers (#9208)
* Allow having multiple voice messages in composers Co-authored-by: grimhilt <grimhilt@users.noreply.github.com> Co-authored-by: Janne Mareike Koschinski <janne@kuschku.de>
This commit is contained in:
parent
85f92308f9
commit
6d03cb35b7
3 changed files with 39 additions and 24 deletions
|
@ -308,7 +308,8 @@ export default class MessageComposer extends React.Component<IProps, IState> {
|
|||
};
|
||||
|
||||
private updateRecordingState() {
|
||||
this.voiceRecording = VoiceRecordingStore.instance.getActiveRecording(this.props.room.roomId);
|
||||
const voiceRecordingId = VoiceRecordingStore.getVoiceRecordingId(this.props.room, this.props.relation);
|
||||
this.voiceRecording = VoiceRecordingStore.instance.getActiveRecording(voiceRecordingId);
|
||||
if (this.voiceRecording) {
|
||||
// If the recording has already started, it's probably a cached one.
|
||||
if (this.voiceRecording.hasRecording && !this.voiceRecording.isRecording) {
|
||||
|
@ -323,7 +324,8 @@ export default class MessageComposer extends React.Component<IProps, IState> {
|
|||
|
||||
private onRecordingStarted = () => {
|
||||
// update the recording instance, just in case
|
||||
this.voiceRecording = VoiceRecordingStore.instance.getActiveRecording(this.props.room.roomId);
|
||||
const voiceRecordingId = VoiceRecordingStore.getVoiceRecordingId(this.props.room, this.props.relation);
|
||||
this.voiceRecording = VoiceRecordingStore.instance.getActiveRecording(voiceRecordingId);
|
||||
this.setState({
|
||||
haveRecording: !!this.voiceRecording,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue