diff options
author | 2019-10-03 17:15:46 +0200 | |
---|---|---|
committer | 2019-10-03 17:15:46 +0200 | |
commit | 6e5bf64ef3ef858a5cc40025f61f3b1cf550d4fe (patch) | |
tree | 0429f9b7af2ff312dfbdb4b184a6cbeec28969ca /src/components/services | |
parent | Automatic i18n update (i18n.meetfranz.com) (diff) | |
parent | update strings (diff) | |
download | ferdium-app-6e5bf64ef3ef858a5cc40025f61f3b1cf550d4fe.tar.gz ferdium-app-6e5bf64ef3ef858a5cc40025f61f3b1cf550d4fe.tar.zst ferdium-app-6e5bf64ef3ef858a5cc40025f61f3b1cf550d4fe.zip |
Merge branch 'release/5.4.0' into i18n
Diffstat (limited to 'src/components/services')
-rw-r--r-- | src/components/services/content/ServiceView.js | 16 | ||||
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 13 | ||||
-rw-r--r-- | src/components/services/content/Services.js | 12 |
3 files changed, 33 insertions, 8 deletions
diff --git a/src/components/services/content/ServiceView.js b/src/components/services/content/ServiceView.js index f65f51346..e8df58a1e 100644 --- a/src/components/services/content/ServiceView.js +++ b/src/components/services/content/ServiceView.js | |||
@@ -12,6 +12,7 @@ import WebviewErrorHandler from './ErrorHandlers/WebviewErrorHandler'; | |||
12 | import ServiceDisabled from './ServiceDisabled'; | 12 | import ServiceDisabled from './ServiceDisabled'; |
13 | import ServiceRestricted from './ServiceRestricted'; | 13 | import ServiceRestricted from './ServiceRestricted'; |
14 | import ServiceWebview from './ServiceWebview'; | 14 | import ServiceWebview from './ServiceWebview'; |
15 | import WebControlsScreen from '../../../features/webControls/containers/WebControlsScreen'; | ||
15 | 16 | ||
16 | export default @observer class ServiceView extends Component { | 17 | export default @observer class ServiceView extends Component { |
17 | static propTypes = { | 18 | static propTypes = { |
@@ -137,11 +138,16 @@ export default @observer class ServiceView extends Component { | |||
137 | type={service.restrictionType} | 138 | type={service.restrictionType} |
138 | /> | 139 | /> |
139 | ) : ( | 140 | ) : ( |
140 | <ServiceWebview | 141 | <> |
141 | service={service} | 142 | {service.recipe.id === 'franz-custom-website' && ( |
142 | setWebviewReference={setWebviewReference} | 143 | <WebControlsScreen service={service} /> |
143 | detachService={detachService} | 144 | )} |
144 | /> | 145 | <ServiceWebview |
146 | service={service} | ||
147 | setWebviewReference={setWebviewReference} | ||
148 | detachService={detachService} | ||
149 | /> | ||
150 | </> | ||
145 | )} | 151 | )} |
146 | </> | 152 | </> |
147 | )} | 153 | )} |
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 7252c695f..b3198d36a 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -20,6 +20,13 @@ class ServiceWebview extends Component { | |||
20 | detachService({ service }); | 20 | detachService({ service }); |
21 | } | 21 | } |
22 | 22 | ||
23 | refocusWebview = () => { | ||
24 | const { webview } = this; | ||
25 | if (!webview) return; | ||
26 | webview.view.blur(); | ||
27 | webview.view.focus(); | ||
28 | }; | ||
29 | |||
23 | render() { | 30 | render() { |
24 | const { | 31 | const { |
25 | service, | 32 | service, |
@@ -28,7 +35,10 @@ class ServiceWebview extends Component { | |||
28 | 35 | ||
29 | return ( | 36 | return ( |
30 | <ElectronWebView | 37 | <ElectronWebView |
31 | ref={(webview) => { this.webview = webview; }} | 38 | ref={(webview) => { |
39 | this.webview = webview; | ||
40 | webview.view.addEventListener('did-stop-loading', this.refocusWebview); | ||
41 | }} | ||
32 | autosize | 42 | autosize |
33 | src={service.url} | 43 | src={service.url} |
34 | preload="./webview/recipe.js" | 44 | preload="./webview/recipe.js" |
@@ -41,6 +51,7 @@ class ServiceWebview extends Component { | |||
41 | }} | 51 | }} |
42 | onUpdateTargetUrl={this.updateTargetUrl} | 52 | onUpdateTargetUrl={this.updateTargetUrl} |
43 | useragent={service.userAgent} | 53 | useragent={service.userAgent} |
54 | disablewebsecurity={service.recipe.disablewebsecurity} | ||
44 | allowpopups | 55 | allowpopups |
45 | /> | 56 | /> |
46 | ); | 57 | ); |
diff --git a/src/components/services/content/Services.js b/src/components/services/content/Services.js index 73c27bfb6..b6291666b 100644 --- a/src/components/services/content/Services.js +++ b/src/components/services/content/Services.js | |||
@@ -56,16 +56,24 @@ export default @observer @injectSheet(styles) class Services extends Component { | |||
56 | 56 | ||
57 | state = { | 57 | state = { |
58 | showConfetti: true, | 58 | showConfetti: true, |
59 | } | 59 | }; |
60 | |||
61 | _confettiTimeout = null; | ||
60 | 62 | ||
61 | componentDidMount() { | 63 | componentDidMount() { |
62 | window.setTimeout(() => { | 64 | this._confettiTimeout = window.setTimeout(() => { |
63 | this.setState({ | 65 | this.setState({ |
64 | showConfetti: false, | 66 | showConfetti: false, |
65 | }); | 67 | }); |
66 | }, ms('8s')); | 68 | }, ms('8s')); |
67 | } | 69 | } |
68 | 70 | ||
71 | componentWillUnmount() { | ||
72 | if (this._confettiTimeout) { | ||
73 | clearTimeout(this._confettiTimeout); | ||
74 | } | ||
75 | } | ||
76 | |||
69 | render() { | 77 | render() { |
70 | const { | 78 | const { |
71 | services, | 79 | services, |