aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/services/content
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2019-09-23 20:18:01 +0200
committerLibravatar vantezzen <hello@vantezzen.io>2019-09-23 20:18:01 +0200
commitaa18d3b84ece4fbc864f6a4f4d3b84fbef564b48 (patch)
treee59f432a96b18626d6fce75f48dd8a8e5f94aafd /src/components/services/content
parentAdd darkreader for universal darkmode (diff)
downloadferdium-app-aa18d3b84ece4fbc864f6a4f4d3b84fbef564b48.tar.gz
ferdium-app-aa18d3b84ece4fbc864f6a4f4d3b84fbef564b48.tar.zst
ferdium-app-aa18d3b84ece4fbc864f6a4f4d3b84fbef564b48.zip
Fix lint
Diffstat (limited to 'src/components/services/content')
-rw-r--r--src/components/services/content/ServiceWebview.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js
index 7252c695f..75b3d2cf0 100644
--- a/src/components/services/content/ServiceWebview.js
+++ b/src/components/services/content/ServiceWebview.js
@@ -1,10 +1,13 @@
1import React, { Component } from 'react'; 1import React, { Component } from 'react';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import { observer } from 'mobx-react'; 3import { observer } from 'mobx-react';
4import { observable, reaction } from 'mobx';
4import ElectronWebView from 'react-electron-web-view'; 5import ElectronWebView from 'react-electron-web-view';
5 6
6import ServiceModel from '../../../models/Service'; 7import ServiceModel from '../../../models/Service';
7 8
9const debug = require('debug')('Ferdi:Services');
10
8@observer 11@observer
9class ServiceWebview extends Component { 12class ServiceWebview extends Component {
10 static propTypes = { 13 static propTypes = {
@@ -13,7 +16,22 @@ class ServiceWebview extends Component {
13 detachService: PropTypes.func.isRequired, 16 detachService: PropTypes.func.isRequired,
14 }; 17 };
15 18
16 webview = null; 19 @observable webview = null;
20
21 constructor(props) {
22 super(props);
23
24 reaction(
25 () => this.webview,
26 () => {
27 if (this.webview.view) {
28 this.webview.view.addEventListener('console-message', (e) => {
29 debug('Service logged a message:', e.message);
30 });
31 }
32 },
33 );
34 }
17 35
18 componentWillUnmount() { 36 componentWillUnmount() {
19 const { service, detachService } = this.props; 37 const { service, detachService } = this.props;