1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +00:00

Fix eslint errors

This commit is contained in:
Vasek Mlejnsky 2018-08-17 06:48:12 +02:00
parent fa52ec41ca
commit 4b9ebce7d0

View File

@ -35,20 +35,12 @@ export default class StickyContainer extends React.PureComponent<Props> {
subscribers = [];
handleResize = (event: Event) => {
// handleResize = (event: Event) => {
}
handleScroll = (event: ?Event) => {
if (!this.framePending) {
this.framePending = true;
raf(this.update);
}
}
// }
shouldUpdate = () => {
const wrapper: ?HTMLElement = this.wrapper;
const aside: ?HTMLElement = this.aside;
const { wrapper, aside }: {wrapper: ?HTMLElement, aside: ?HTMLElement} = this;
if (!wrapper || !aside) return;
const bottom: ?HTMLElement = wrapper.querySelector('.sticky-bottom');
if (!bottom) return;
@ -107,11 +99,6 @@ export default class StickyContainer extends React.PureComponent<Props> {
raf(this.update);
}
componentWillUnmount() {
window.removeEventListener('scroll', this.handleScroll);
window.removeEventListener('resize', this.handleScroll);
}
componentDidUpdate(prevProps: Props) {
if (this.props.location !== prevProps.location && this.aside) {
const asideBounds = this.aside.getBoundingClientRect();
@ -128,6 +115,18 @@ export default class StickyContainer extends React.PureComponent<Props> {
}
}
componentWillUnmount() {
window.removeEventListener('scroll', this.handleScroll);
window.removeEventListener('resize', this.handleScroll);
}
handleScroll = (/* event: ?Event */) => {
if (!this.framePending) {
this.framePending = true;
raf(this.update);
}
}
render() {
return (
<aside