mirror of
https://github.com/element-hq/element-web
synced 2024-10-24 03:35:50 +03:00
Merge pull request #6101 from jaiwanth-v/voice-message-destroy
Destroy playback instance on voice message unmount
This commit is contained in:
commit
84bdd61119
1 changed files with 5 additions and 1 deletions
|
@ -71,10 +71,14 @@ export default class MVoiceMessageBody extends React.PureComponent<IProps, IStat
|
|||
|
||||
// We should have a buffer to work with now: let's set it up
|
||||
const playback = new Playback(buffer, waveform);
|
||||
this.setState({playback});
|
||||
this.setState({ playback });
|
||||
// Note: the RecordingPlayback component will handle preparing the Playback class for us.
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
this.state.playback?.destroy();
|
||||
}
|
||||
|
||||
public render() {
|
||||
if (this.state.error) {
|
||||
// TODO: @@TR: Verify error state
|
||||
|
|
Loading…
Reference in a new issue