Skip to content

Commit 9541f1c

Browse files
committed
app: fix linting errors
1 parent f79ba06 commit 9541f1c

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

app/components/Epub/index.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component, findDOMNode } from 'react';
1+
import React, { Component } from 'react';
22
import ePub from 'epubjs';
33
import getStreamHost from '../../utils/get-stream-host';
44
import './Epub.scss';
@@ -29,10 +29,6 @@ class Epub extends Component {
2929
}
3030

3131

32-
componentWillUnmount() {
33-
this._stop();
34-
}
35-
3632
componentWillUpdate(nextProps) {
3733
if (nextProps.location !== this.props.location) {
3834
this._visibleLocation = nextProps.location;
@@ -48,8 +44,15 @@ class Epub extends Component {
4844
}
4945
}
5046

47+
componentWillUnmount() {
48+
this._stop();
49+
}
50+
51+
5152
display(what) {
52-
this.rendition && this.rendition.display(what);
53+
if (this.rendition) {
54+
this.rendition.display(what);
55+
}
5356
}
5457

5558
_start() {

app/components/Reader/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ class Reader extends Component {
1212
this.handleNavReady = this.handleNavReady.bind(this);
1313
}
1414

15-
componentDidMount() {
15+
state = {
16+
isLoading: true,
17+
nav: [],
18+
location: 0
19+
};
20+
21+
componentWillMount() {
1622
if (this.props.book) {
1723
const location = localStorage.getItem(`${this.props.book.id}-location`);
1824

1925
if (location) {
20-
console.log('location is', location);
2126
this.setState({ ...this.state, location });
2227
}
2328
}
2429
}
2530

26-
state = {
27-
isLoading: true,
28-
nav: [],
29-
location: 0
30-
};
3131

3232
handleNavReady(nav) {
3333
this.setState({ ...this.state, nav });

0 commit comments

Comments
 (0)