mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-15 22:31:32 +01:00
Destroy playback instance on unmount
This commit is contained in:
parent
a22141616e
commit
a4907f8061
@ -71,10 +71,16 @@ 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() {
|
||||
if (this.state.playback) {
|
||||
this.state.playback.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
public render() {
|
||||
if (this.state.error) {
|
||||
// TODO: @@TR: Verify error state
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user