diff options
author | Stefan Malzner <stefan@adlk.io> | 2018-12-08 17:08:58 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2018-12-08 17:08:58 +0100 |
commit | a5e7171402eb27a4527a238d186c88ac03f8ffd7 (patch) | |
tree | 897708a2cfc88569c04f4896bacf2c9d390c7b39 /src/components/services/content/ServiceWebview.js | |
parent | Add service spellchecker language strings (diff) | |
download | ferdium-app-a5e7171402eb27a4527a238d186c88ac03f8ffd7.tar.gz ferdium-app-a5e7171402eb27a4527a238d186c88ac03f8ffd7.tar.zst ferdium-app-a5e7171402eb27a4527a238d186c88ac03f8ffd7.zip |
feat(Service): Add error screen for services that failed to load
Diffstat (limited to 'src/components/services/content/ServiceWebview.js')
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 6e56de92f..b3def3fa5 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -7,7 +7,9 @@ import classnames from 'classnames'; | |||
7 | 7 | ||
8 | import ServiceModel from '../../../models/Service'; | 8 | import ServiceModel from '../../../models/Service'; |
9 | import StatusBarTargetUrl from '../../ui/StatusBarTargetUrl'; | 9 | import StatusBarTargetUrl from '../../ui/StatusBarTargetUrl'; |
10 | import WebviewLoader from '../../ui/WebviewLoader'; | ||
10 | import WebviewCrashHandler from './WebviewCrashHandler'; | 11 | import WebviewCrashHandler from './WebviewCrashHandler'; |
12 | import WebviewErrorHandler from './ErrorHandlers/WebviewErrorHandler'; | ||
11 | import ServiceDisabled from './ServiceDisabled'; | 13 | import ServiceDisabled from './ServiceDisabled'; |
12 | 14 | ||
13 | export default @observer class ServiceWebview extends Component { | 15 | export default @observer class ServiceWebview extends Component { |
@@ -15,6 +17,7 @@ export default @observer class ServiceWebview extends Component { | |||
15 | service: PropTypes.instanceOf(ServiceModel).isRequired, | 17 | service: PropTypes.instanceOf(ServiceModel).isRequired, |
16 | setWebviewReference: PropTypes.func.isRequired, | 18 | setWebviewReference: PropTypes.func.isRequired, |
17 | reload: PropTypes.func.isRequired, | 19 | reload: PropTypes.func.isRequired, |
20 | edit: PropTypes.func.isRequired, | ||
18 | isAppMuted: PropTypes.bool.isRequired, | 21 | isAppMuted: PropTypes.bool.isRequired, |
19 | enable: PropTypes.func.isRequired, | 22 | enable: PropTypes.func.isRequired, |
20 | }; | 23 | }; |
@@ -58,6 +61,7 @@ export default @observer class ServiceWebview extends Component { | |||
58 | service, | 61 | service, |
59 | setWebviewReference, | 62 | setWebviewReference, |
60 | reload, | 63 | reload, |
64 | edit, | ||
61 | isAppMuted, | 65 | isAppMuted, |
62 | enable, | 66 | enable, |
63 | } = this.props; | 67 | } = this.props; |
@@ -85,6 +89,20 @@ export default @observer class ServiceWebview extends Component { | |||
85 | reload={reload} | 89 | reload={reload} |
86 | /> | 90 | /> |
87 | )} | 91 | )} |
92 | {service.isLoading && ( | ||
93 | <WebviewLoader | ||
94 | loaded={!service.isLoading} | ||
95 | name={service.name} | ||
96 | /> | ||
97 | )} | ||
98 | {service.isError && ( | ||
99 | <WebviewErrorHandler | ||
100 | name={service.recipe.name} | ||
101 | errorMessage={service.errorMessage} | ||
102 | reload={reload} | ||
103 | edit={edit} | ||
104 | /> | ||
105 | )} | ||
88 | {!service.isEnabled ? ( | 106 | {!service.isEnabled ? ( |
89 | <ServiceDisabled | 107 | <ServiceDisabled |
90 | name={service.recipe.name} | 108 | name={service.recipe.name} |