mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 12:16:53 +02:00
make resizeNotifier optional so tests don't fail
This commit is contained in:
parent
82e44249ff
commit
41c5582a7b
@ -392,7 +392,9 @@ module.exports = React.createClass({
|
||||
this._updateConfCallNotification();
|
||||
|
||||
window.addEventListener('beforeunload', this.onPageUnload);
|
||||
this.props.resizeNotifier.on("middlePanelResized", this.onResize);
|
||||
if (this.props.resizeNotifier) {
|
||||
this.props.resizeNotifier.on("middlePanelResized", this.onResize);
|
||||
}
|
||||
this.onResize();
|
||||
|
||||
document.addEventListener("keydown", this.onKeyDown);
|
||||
@ -472,7 +474,9 @@ module.exports = React.createClass({
|
||||
}
|
||||
|
||||
window.removeEventListener('beforeunload', this.onPageUnload);
|
||||
this.props.resizeNotifier.removeListener("middlePanelResized", this.onResize);
|
||||
if (this.props.resizeNotifier) {
|
||||
this.props.resizeNotifier.removeListener("middlePanelResized", this.onResize);
|
||||
}
|
||||
|
||||
document.removeEventListener("keydown", this.onKeyDown);
|
||||
|
||||
|
||||
@ -212,7 +212,9 @@ module.exports = React.createClass({
|
||||
this._checkSubListsOverflow();
|
||||
|
||||
this.resizer.attach();
|
||||
this.props.resizeNotifier.on("leftPanelResized", this.onResize);
|
||||
if (this.props.resizeNotifier) {
|
||||
this.props.resizeNotifier.on("leftPanelResized", this.onResize);
|
||||
}
|
||||
this.mounted = true;
|
||||
},
|
||||
|
||||
@ -271,7 +273,10 @@ module.exports = React.createClass({
|
||||
MatrixClientPeg.get().removeListener("Group.myMembership", this._onGroupMyMembership);
|
||||
MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvents);
|
||||
}
|
||||
this.props.resizeNotifier.removeListener("leftPanelResized", this.onResize);
|
||||
|
||||
if (this.props.resizeNotifier) {
|
||||
this.props.resizeNotifier.removeListener("leftPanelResized", this.onResize);
|
||||
}
|
||||
|
||||
|
||||
if (this._tagStoreToken) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user