diff options
author | Stefan Malzner <stefan@adlk.io> | 2018-12-13 14:01:33 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2018-12-13 14:01:33 +0100 |
commit | b5937bd427e02d64b675c9c4719ec8148c68c224 (patch) | |
tree | 3e67ca01935eb36ab6d40a1e197d7c2c0f38b587 /src/features/serviceProxy/index.js | |
parent | Update CHANGELOG.md (diff) | |
parent | Ignore clicks on premium elements (diff) | |
download | ferdium-app-b5937bd427e02d64b675c9c4719ec8148c68c224.tar.gz ferdium-app-b5937bd427e02d64b675c9c4719ec8148c68c224.tar.zst ferdium-app-b5937bd427e02d64b675c9c4719ec8148c68c224.zip |
Merge branch 'develop'v5.0.0-beta.21
Diffstat (limited to 'src/features/serviceProxy/index.js')
-rw-r--r-- | src/features/serviceProxy/index.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/features/serviceProxy/index.js b/src/features/serviceProxy/index.js index ee0b4e79c..4bea327ad 100644 --- a/src/features/serviceProxy/index.js +++ b/src/features/serviceProxy/index.js | |||
@@ -23,15 +23,18 @@ export default function init(stores) { | |||
23 | 23 | ||
24 | const services = stores.services.enabled; | 24 | const services = stores.services.enabled; |
25 | const isPremiumUser = stores.user.data.isPremium; | 25 | const isPremiumUser = stores.user.data.isPremium; |
26 | const proxySettings = stores.settings.proxy; | ||
27 | |||
28 | debug('Service Proxy autorun'); | ||
26 | 29 | ||
27 | services.forEach((service) => { | 30 | services.forEach((service) => { |
28 | const s = session.fromPartition(`persist:service-${service.id}`); | 31 | const s = session.fromPartition(`persist:service-${service.id}`); |
29 | 32 | ||
30 | if (config.isEnabled && (isPremiumUser || !config.isPremium)) { | 33 | if (config.isEnabled && (isPremiumUser || !config.isPremium)) { |
31 | const serviceProxyConfig = stores.settings.proxy[service.id]; | 34 | const serviceProxyConfig = proxySettings[service.id]; |
32 | 35 | ||
33 | if (serviceProxyConfig && serviceProxyConfig.isEnabled && serviceProxyConfig.host) { | 36 | if (serviceProxyConfig && serviceProxyConfig.isEnabled && serviceProxyConfig.host) { |
34 | const proxyHost = serviceProxyConfig.host; | 37 | const proxyHost = `${serviceProxyConfig.host}${serviceProxyConfig.port ? `:${serviceProxyConfig.port}` : ''}`; |
35 | debug(`Setting proxy config from service settings for "${service.name}" (${service.id}) to`, proxyHost); | 38 | debug(`Setting proxy config from service settings for "${service.name}" (${service.id}) to`, proxyHost); |
36 | 39 | ||
37 | s.setProxy({ proxyRules: proxyHost }, () => { | 40 | s.setProxy({ proxyRules: proxyHost }, () => { |
@@ -42,4 +45,3 @@ export default function init(stores) { | |||
42 | }); | 45 | }); |
43 | }); | 46 | }); |
44 | } | 47 | } |
45 | |||