diff options
author | 2021-09-13 14:45:46 +0200 | |
---|---|---|
committer | 2021-09-13 14:45:46 +0200 | |
commit | 537697a6e9757f118d09d9e76362ba1ff617e2c6 (patch) | |
tree | bc55447115e385137684e84697a8c15d2199b8d5 /src/components/services/content/WebviewCrashHandler.js | |
parent | Bumped up version to: 5.6.3-nightly.0 [skip ci] (diff) | |
download | ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.gz ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.zst ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.zip |
chore: upgrade intl dependencies (#1920)
Diffstat (limited to 'src/components/services/content/WebviewCrashHandler.js')
-rw-r--r-- | src/components/services/content/WebviewCrashHandler.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/components/services/content/WebviewCrashHandler.js b/src/components/services/content/WebviewCrashHandler.js index 10ff0bbbb..a332602be 100644 --- a/src/components/services/content/WebviewCrashHandler.js +++ b/src/components/services/content/WebviewCrashHandler.js | |||
@@ -1,7 +1,7 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, injectIntl } from 'react-intl'; |
5 | import ms from 'ms'; | 5 | import ms from 'ms'; |
6 | 6 | ||
7 | import Button from '../../ui/Button'; | 7 | import Button from '../../ui/Button'; |
@@ -9,35 +9,33 @@ import Button from '../../ui/Button'; | |||
9 | const messages = defineMessages({ | 9 | const messages = defineMessages({ |
10 | headline: { | 10 | headline: { |
11 | id: 'service.crashHandler.headline', | 11 | id: 'service.crashHandler.headline', |
12 | defaultMessage: '!!!Oh no!', | 12 | defaultMessage: 'Oh no!', |
13 | }, | 13 | }, |
14 | text: { | 14 | text: { |
15 | id: 'service.crashHandler.text', | 15 | id: 'service.crashHandler.text', |
16 | defaultMessage: '!!!{name} has caused an error.', | 16 | defaultMessage: '{name} has caused an error.', |
17 | }, | 17 | }, |
18 | action: { | 18 | action: { |
19 | id: 'service.crashHandler.action', | 19 | id: 'service.crashHandler.action', |
20 | defaultMessage: '!!!Reload {name}', | 20 | defaultMessage: 'Reload {name}', |
21 | }, | 21 | }, |
22 | autoReload: { | 22 | autoReload: { |
23 | id: 'service.crashHandler.autoReload', | 23 | id: 'service.crashHandler.autoReload', |
24 | defaultMessage: '!!!Trying to automatically restore {name} in {seconds} seconds', | 24 | defaultMessage: |
25 | 'Trying to automatically restore {name} in {seconds} seconds', | ||
25 | }, | 26 | }, |
26 | }); | 27 | }); |
27 | 28 | ||
28 | export default @observer class WebviewCrashHandler extends Component { | 29 | @observer |
30 | class WebviewCrashHandler extends Component { | ||
29 | static propTypes = { | 31 | static propTypes = { |
30 | name: PropTypes.string.isRequired, | 32 | name: PropTypes.string.isRequired, |
31 | reload: PropTypes.func.isRequired, | 33 | reload: PropTypes.func.isRequired, |
32 | }; | 34 | }; |
33 | 35 | ||
34 | static contextTypes = { | ||
35 | intl: intlShape, | ||
36 | }; | ||
37 | |||
38 | state = { | 36 | state = { |
39 | countdown: ms('10s'), | 37 | countdown: ms('10s'), |
40 | } | 38 | }; |
41 | 39 | ||
42 | countdownInterval = null; | 40 | countdownInterval = null; |
43 | 41 | ||
@@ -47,7 +45,7 @@ export default @observer class WebviewCrashHandler extends Component { | |||
47 | const { reload } = this.props; | 45 | const { reload } = this.props; |
48 | 46 | ||
49 | this.countdownInterval = setInterval(() => { | 47 | this.countdownInterval = setInterval(() => { |
50 | this.setState((prevState) => ({ | 48 | this.setState(prevState => ({ |
51 | countdown: prevState.countdown - this.countdownIntervalTimeout, | 49 | countdown: prevState.countdown - this.countdownIntervalTimeout, |
52 | })); | 50 | })); |
53 | 51 | ||
@@ -60,7 +58,7 @@ export default @observer class WebviewCrashHandler extends Component { | |||
60 | 58 | ||
61 | render() { | 59 | render() { |
62 | const { name, reload } = this.props; | 60 | const { name, reload } = this.props; |
63 | const { intl } = this.context; | 61 | const { intl } = this.props; |
64 | 62 | ||
65 | return ( | 63 | return ( |
66 | <div className="services__info-layer"> | 64 | <div className="services__info-layer"> |
@@ -82,3 +80,5 @@ export default @observer class WebviewCrashHandler extends Component { | |||
82 | ); | 80 | ); |
83 | } | 81 | } |
84 | } | 82 | } |
83 | |||
84 | export default injectIntl(WebviewCrashHandler); | ||