diff options
author | 2018-12-09 20:48:25 +0100 | |
---|---|---|
committer | 2018-12-09 20:48:25 +0100 | |
commit | 5d6164973e92fa8a3e3c18a0eb2e29494aea4f48 (patch) | |
tree | 382e6c672bbc0f7582b3b627b02111dcce902894 /src/components/services | |
parent | Add React 16 didCatch/ErrorBoundary component (diff) | |
download | ferdium-app-5d6164973e92fa8a3e3c18a0eb2e29494aea4f48.tar.gz ferdium-app-5d6164973e92fa8a3e3c18a0eb2e29494aea4f48.tar.zst ferdium-app-5d6164973e92fa8a3e3c18a0eb2e29494aea4f48.zip |
Fix linting issues
Diffstat (limited to 'src/components/services')
6 files changed, 30 insertions, 18 deletions
diff --git a/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js b/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js index df98bf835..415a8d1b5 100644 --- a/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js +++ b/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js | |||
@@ -58,7 +58,14 @@ export default @injectSheet(styles) @observer class WebviewCrashHandler extends | |||
58 | <div className={classes.component}> | 58 | <div className={classes.component}> |
59 | <h1>{intl.formatMessage(messages.headline)}</h1> | 59 | <h1>{intl.formatMessage(messages.headline)}</h1> |
60 | <p>{intl.formatMessage(messages.text, { name })}</p> | 60 | <p>{intl.formatMessage(messages.text, { name })}</p> |
61 | <p><strong>{intl.formatMessage(messages.errorMessage)}:</strong> {errorMessage}</p> | 61 | <p> |
62 | <strong> | ||
63 | {intl.formatMessage(messages.errorMessage)} | ||
64 | : | ||
65 | </strong> | ||
66 | {' '} | ||
67 | {errorMessage} | ||
68 | </p> | ||
62 | <div className={classes.buttonContainer}> | 69 | <div className={classes.buttonContainer}> |
63 | <Button | 70 | <Button |
64 | label={intl.formatMessage(messages.editAction, { name })} | 71 | label={intl.formatMessage(messages.editAction, { name })} |
diff --git a/src/components/services/content/ServiceDisabled.js b/src/components/services/content/ServiceDisabled.js index 58fb38d8c..d0f12256e 100644 --- a/src/components/services/content/ServiceDisabled.js +++ b/src/components/services/content/ServiceDisabled.js | |||
@@ -27,6 +27,7 @@ export default @observer class ServiceDisabled extends Component { | |||
27 | }; | 27 | }; |
28 | 28 | ||
29 | countdownInterval = null; | 29 | countdownInterval = null; |
30 | |||
30 | countdownIntervalTimeout = 1000; | 31 | countdownIntervalTimeout = 1000; |
31 | 32 | ||
32 | render() { | 33 | render() { |
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 98daf9b9f..a2ae5a562 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -20,6 +20,7 @@ export default @observer class ServiceWebview extends Component { | |||
20 | edit: PropTypes.func.isRequired, | 20 | edit: PropTypes.func.isRequired, |
21 | isAppMuted: PropTypes.bool.isRequired, | 21 | isAppMuted: PropTypes.bool.isRequired, |
22 | enable: PropTypes.func.isRequired, | 22 | enable: PropTypes.func.isRequired, |
23 | isActive: PropTypes.bool, | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | static defaultProps = { | 26 | static defaultProps = { |
@@ -32,6 +33,10 @@ export default @observer class ServiceWebview extends Component { | |||
32 | statusBarVisible: false, | 33 | statusBarVisible: false, |
33 | }; | 34 | }; |
34 | 35 | ||
36 | autorunDisposer = null; | ||
37 | |||
38 | webview = null; | ||
39 | |||
35 | componentDidMount() { | 40 | componentDidMount() { |
36 | this.autorunDisposer = autorun(() => { | 41 | this.autorunDisposer = autorun(() => { |
37 | if (this.props.service.isActive) { | 42 | if (this.props.service.isActive) { |
@@ -58,10 +63,6 @@ export default @observer class ServiceWebview extends Component { | |||
58 | }); | 63 | }); |
59 | } | 64 | } |
60 | 65 | ||
61 | autorunDisposer = null; | ||
62 | |||
63 | webview = null; | ||
64 | |||
65 | render() { | 66 | render() { |
66 | const { | 67 | const { |
67 | service, | 68 | service, |
diff --git a/src/components/services/content/Services.js b/src/components/services/content/Services.js index 0d4d778cd..1aeb17e03 100644 --- a/src/components/services/content/Services.js +++ b/src/components/services/content/Services.js | |||
@@ -20,7 +20,7 @@ const messages = defineMessages({ | |||
20 | 20 | ||
21 | export default @observer class Services extends Component { | 21 | export default @observer class Services extends Component { |
22 | static propTypes = { | 22 | static propTypes = { |
23 | services: MobxPropTypes.arrayOrObservableArray.isRequired, | 23 | services: MobxPropTypes.arrayOrObservableArray, |
24 | setWebviewReference: PropTypes.func.isRequired, | 24 | setWebviewReference: PropTypes.func.isRequired, |
25 | handleIPCMessage: PropTypes.func.isRequired, | 25 | handleIPCMessage: PropTypes.func.isRequired, |
26 | openWindow: PropTypes.func.isRequired, | 26 | openWindow: PropTypes.func.isRequired, |
@@ -32,7 +32,6 @@ export default @observer class Services extends Component { | |||
32 | 32 | ||
33 | static defaultProps = { | 33 | static defaultProps = { |
34 | services: [], | 34 | services: [], |
35 | activeService: '', | ||
36 | }; | 35 | }; |
37 | 36 | ||
38 | static contextTypes = { | 37 | static contextTypes = { |
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 | } |
diff --git a/src/components/services/tabs/Tabbar.js b/src/components/services/tabs/Tabbar.js index 27f555428..dd5c2140f 100644 --- a/src/components/services/tabs/Tabbar.js +++ b/src/components/services/tabs/Tabbar.js | |||
@@ -1,4 +1,4 @@ | |||
1 | import React, { Component, Fragment } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; | 3 | import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; |
4 | 4 | ||