aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/components/services/content/ServiceWebview.js20
-rw-r--r--src/features/quickSwitch/Component.js3
-rw-r--r--src/i18n/locales/defaultMessages.json8
-rw-r--r--src/i18n/messages/src/features/quickSwitch/Component.json8
-rw-r--r--src/webview/recipe.js2
5 files changed, 31 insertions, 10 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;
diff --git a/src/features/quickSwitch/Component.js b/src/features/quickSwitch/Component.js
index 3217a3d93..ddbdbe304 100644
--- a/src/features/quickSwitch/Component.js
+++ b/src/features/quickSwitch/Component.js
@@ -1,4 +1,5 @@
1import React, { Component, createRef } from 'react'; 1import React, { Component, createRef } from 'react';
2import { remote } from 'electron';
2import PropTypes from 'prop-types'; 3import PropTypes from 'prop-types';
3import { observer, inject } from 'mobx-react'; 4import { observer, inject } from 'mobx-react';
4import { reaction } from 'mobx'; 5import { reaction } from 'mobx';
@@ -190,6 +191,8 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class
190 if (isModalVisible && !this.state.wasPrevVisible) { 191 if (isModalVisible && !this.state.wasPrevVisible) {
191 // Set focus back on current window if its in a service 192 // Set focus back on current window if its in a service
192 // TODO: Find a way to gain back focus 193 // TODO: Find a way to gain back focus
194 remote.getCurrentWindow().blurWebView();
195 remote.getCurrentWindow().webContents.focus();
193 196
194 // The input "focus" attribute will only work on first modal open 197 // The input "focus" attribute will only work on first modal open
195 // Manually add focus to the input element 198 // Manually add focus to the input element
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json
index de1712048..ccb81a9f3 100644
--- a/src/i18n/locales/defaultMessages.json
+++ b/src/i18n/locales/defaultMessages.json
@@ -4167,26 +4167,26 @@
4167 "defaultMessage": "!!!Search...", 4167 "defaultMessage": "!!!Search...",
4168 "end": { 4168 "end": {
4169 "column": 3, 4169 "column": 3,
4170 "line": 17 4170 "line": 18
4171 }, 4171 },
4172 "file": "src/features/quickSwitch/Component.js", 4172 "file": "src/features/quickSwitch/Component.js",
4173 "id": "feature.quickSwitch.search", 4173 "id": "feature.quickSwitch.search",
4174 "start": { 4174 "start": {
4175 "column": 10, 4175 "column": 10,
4176 "line": 14 4176 "line": 15
4177 } 4177 }
4178 }, 4178 },
4179 { 4179 {
4180 "defaultMessage": "!!!Select a service with TAB, ↑ and ↓. Open a service with ENTER.", 4180 "defaultMessage": "!!!Select a service with TAB, ↑ and ↓. Open a service with ENTER.",
4181 "end": { 4181 "end": {
4182 "column": 3, 4182 "column": 3,
4183 "line": 21 4183 "line": 22
4184 }, 4184 },
4185 "file": "src/features/quickSwitch/Component.js", 4185 "file": "src/features/quickSwitch/Component.js",
4186 "id": "feature.quickSwitch.info", 4186 "id": "feature.quickSwitch.info",
4187 "start": { 4187 "start": {
4188 "column": 8, 4188 "column": 8,
4189 "line": 18 4189 "line": 19
4190 } 4190 }
4191 } 4191 }
4192 ], 4192 ],
diff --git a/src/i18n/messages/src/features/quickSwitch/Component.json b/src/i18n/messages/src/features/quickSwitch/Component.json
index 248925a37..f42e1af49 100644
--- a/src/i18n/messages/src/features/quickSwitch/Component.json
+++ b/src/i18n/messages/src/features/quickSwitch/Component.json
@@ -4,11 +4,11 @@
4 "defaultMessage": "!!!Search...", 4 "defaultMessage": "!!!Search...",
5 "file": "src/features/quickSwitch/Component.js", 5 "file": "src/features/quickSwitch/Component.js",
6 "start": { 6 "start": {
7 "line": 14, 7 "line": 15,
8 "column": 10 8 "column": 10
9 }, 9 },
10 "end": { 10 "end": {
11 "line": 17, 11 "line": 18,
12 "column": 3 12 "column": 3
13 } 13 }
14 }, 14 },
@@ -17,11 +17,11 @@
17 "defaultMessage": "!!!Select a service with TAB, ↑ and ↓. Open a service with ENTER.", 17 "defaultMessage": "!!!Select a service with TAB, ↑ and ↓. Open a service with ENTER.",
18 "file": "src/features/quickSwitch/Component.js", 18 "file": "src/features/quickSwitch/Component.js",
19 "start": { 19 "start": {
20 "line": 18, 20 "line": 19,
21 "column": 8 21 "column": 8
22 }, 22 },
23 "end": { 23 "end": {
24 "line": 21, 24 "line": 22,
25 "column": 3 25 "column": 3
26 } 26 }
27 } 27 }
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index e97013b3c..fca00fde2 100644
--- a/src/webview/recipe.js
+++ b/src/webview/recipe.js
@@ -114,7 +114,7 @@ class RecipeController {
114 } 114 }
115 } 115 }
116 116
117 if (this.settings.service.isDarkModeEnabled || this.settings.app.darkMode) { 117 if (this.settings.service.isDarkModeEnabled || this.settings.app.darkMode) {
118 debug('Enable dark mode'); 118 debug('Enable dark mode');
119 119
120 // Check if recipe has a darkmode.css 120 // Check if recipe has a darkmode.css