aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/services/content/WebviewCrashHandler.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-12-09 20:48:25 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2018-12-09 20:48:25 +0100
commit5d6164973e92fa8a3e3c18a0eb2e29494aea4f48 (patch)
tree382e6c672bbc0f7582b3b627b02111dcce902894 /src/components/services/content/WebviewCrashHandler.js
parentAdd React 16 didCatch/ErrorBoundary component (diff)
downloadferdium-app-5d6164973e92fa8a3e3c18a0eb2e29494aea4f48.tar.gz
ferdium-app-5d6164973e92fa8a3e3c18a0eb2e29494aea4f48.tar.zst
ferdium-app-5d6164973e92fa8a3e3c18a0eb2e29494aea4f48.zip
Fix linting issues
Diffstat (limited to 'src/components/services/content/WebviewCrashHandler.js')
-rw-r--r--src/components/services/content/WebviewCrashHandler.js24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/components/services/content/WebviewCrashHandler.js b/src/components/services/content/WebviewCrashHandler.js
index 3be1fccf4..42bc3c877 100644
--- a/src/components/services/content/WebviewCrashHandler.js
+++ b/src/components/services/content/WebviewCrashHandler.js
@@ -38,13 +38,18 @@ export default @observer class WebviewCrashHandler extends Component {
38 countdown: 10000, 38 countdown: 10000,
39 } 39 }
40 40
41 countdownInterval = null;
42
43 countdownIntervalTimeout = 1000;
44
45
41 componentDidMount() { 46 componentDidMount() {
42 const { reload } = this.props; 47 const { reload } = this.props;
43 48
44 this.countdownInterval = setInterval(() => { 49 this.countdownInterval = setInterval(() => {
45 this.setState({ 50 this.setState(prevState => ({
46 countdown: this.state.countdown - this.countdownIntervalTimeout, 51 countdown: prevState.countdown - this.countdownIntervalTimeout,
47 }); 52 }));
48 53
49 if (this.state.countdown <= 0) { 54 if (this.state.countdown <= 0) {
50 reload(); 55 reload();
@@ -53,9 +58,6 @@ export default @observer class WebviewCrashHandler extends Component {
53 }, this.countdownIntervalTimeout); 58 }, this.countdownIntervalTimeout);
54 } 59 }
55 60
56 countdownInterval = null;
57 countdownIntervalTimeout = 1000;
58
59 render() { 61 render() {
60 const { name, reload } = this.props; 62 const { name, reload } = this.props;
61 const { intl } = this.context; 63 const { intl } = this.context;
@@ -70,10 +72,12 @@ export default @observer class WebviewCrashHandler extends Component {
70 buttonType="inverted" 72 buttonType="inverted"
71 onClick={() => reload()} 73 onClick={() => reload()}
72 /> 74 />
73 <p className="footnote">{intl.formatMessage(messages.autoReload, { 75 <p className="footnote">
74 name, 76 {intl.formatMessage(messages.autoReload, {
75 seconds: this.state.countdown / 1000, 77 name,
76 })}</p> 78 seconds: this.state.countdown / 1000,
79 })}
80 </p>
77 </div> 81 </div>
78 ); 82 );
79 } 83 }