summaryrefslogtreecommitdiffstats
path: root/src/features/serviceProxy/index.ts
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2022-04-22 15:04:21 -0500
committerLibravatar GitHub <noreply@github.com>2022-04-22 20:04:21 +0000
commit759d93dc198a3cc8c5265245c0144efa5435682b (patch)
tree53e963a085d3d12af5a2efa2f1ab6f3e5574edc7 /src/features/serviceProxy/index.ts
parentAdded build scripts for linux, macos and windows to help new contributors get... (diff)
downloadferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.gz
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.zst
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.zip
Turn off usage of 'debug' npm package using with electron-16 (fixes #17)
Diffstat (limited to 'src/features/serviceProxy/index.ts')
-rw-r--r--src/features/serviceProxy/index.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/features/serviceProxy/index.ts b/src/features/serviceProxy/index.ts
index bdc21e97e..b3705b190 100644
--- a/src/features/serviceProxy/index.ts
+++ b/src/features/serviceProxy/index.ts
@@ -1,7 +1,8 @@
1import { autorun, observable } from 'mobx'; 1import { autorun, observable } from 'mobx';
2import { session } from '@electron/remote'; 2import { session } from '@electron/remote';
3 3
4const debug = require('debug')('Ferdium:feature:serviceProxy'); 4// TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed
5// const debug = require('debug')('Ferdium:feature:serviceProxy');
5 6
6export const config = observable({ 7export const config = observable({
7 isEnabled: true, 8 isEnabled: true,
@@ -11,7 +12,7 @@ export default function init(stores: {
11 services: { enabled: any }; 12 services: { enabled: any };
12 settings: { proxy: any }; 13 settings: { proxy: any };
13}) { 14}) {
14 debug('Initializing `serviceProxy` feature'); 15 console.log('Initializing `serviceProxy` feature');
15 16
16 autorun(() => { 17 autorun(() => {
17 config.isEnabled = true; 18 config.isEnabled = true;
@@ -19,7 +20,7 @@ export default function init(stores: {
19 const services = stores.services.enabled; 20 const services = stores.services.enabled;
20 const proxySettings = stores.settings.proxy; 21 const proxySettings = stores.settings.proxy;
21 22
22 debug('Service Proxy autorun'); 23 console.log('Service Proxy autorun');
23 24
24 for (const service of services) { 25 for (const service of services) {
25 const s = session.fromPartition(`persist:service-${service.id}`); 26 const s = session.fromPartition(`persist:service-${service.id}`);
@@ -35,14 +36,14 @@ export default function init(stores: {
35 const proxyHost = `${serviceProxyConfig.host}${ 36 const proxyHost = `${serviceProxyConfig.host}${
36 serviceProxyConfig.port ? `:${serviceProxyConfig.port}` : '' 37 serviceProxyConfig.port ? `:${serviceProxyConfig.port}` : ''
37 }`; 38 }`;
38 debug( 39 console.log(
39 `Setting proxy config from service settings for "${service.name}" (${service.id}) to`, 40 `Setting proxy config from service settings for "${service.name}" (${service.id}) to`,
40 proxyHost, 41 proxyHost,
41 ); 42 );
42 43
43 s.setProxy({ proxyRules: proxyHost }) 44 s.setProxy({ proxyRules: proxyHost })
44 .then(() => { 45 .then(() => {
45 debug( 46 console.log(
46 `Using proxy "${proxyHost}" for "${service.name}" (${service.id})`, 47 `Using proxy "${proxyHost}" for "${service.name}" (${service.id})`,
47 ); 48 );
48 }) 49 })