You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Reinstate the DnD event listener removals, with comments
This commit is contained in:
@ -77,6 +77,17 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
|
if (this.refs.messagePanel) {
|
||||||
|
// disconnect the D&D event listeners from the message panel. This
|
||||||
|
// is really just for hygiene - the messagePanel is going to be
|
||||||
|
// deleted anyway, so it doesn't matter if the event listeners
|
||||||
|
// don't get cleaned up.
|
||||||
|
var messagePanel = ReactDOM.findDOMNode(this.refs.messagePanel);
|
||||||
|
messagePanel.removeEventListener('drop', this.onDrop);
|
||||||
|
messagePanel.removeEventListener('dragover', this.onDragOver);
|
||||||
|
messagePanel.removeEventListener('dragleave', this.onDragLeaveOrEnd);
|
||||||
|
messagePanel.removeEventListener('dragend', this.onDragLeaveOrEnd);
|
||||||
|
}
|
||||||
dis.unregister(this.dispatcherRef);
|
dis.unregister(this.dispatcherRef);
|
||||||
if (MatrixClientPeg.get()) {
|
if (MatrixClientPeg.get()) {
|
||||||
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
|
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
|
||||||
|
Reference in New Issue
Block a user