diff options
author | Stefan Malzner <stefan@adlk.io> | 2017-11-23 16:17:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-23 16:17:34 +0100 |
commit | abca425e4a7b63be93132067bc335e8b6b39c2b2 (patch) | |
tree | e386f3e5d4c1c1caff19e3555e7ed1ce93e625f6 /src/lib | |
parent | replace typeform (diff) | |
parent | Add windows notification fix to changelog (diff) | |
download | ferdium-app-abca425e4a7b63be93132067bc335e8b6b39c2b2.tar.gz ferdium-app-abca425e4a7b63be93132067bc335e8b6b39c2b2.tar.zst ferdium-app-abca425e4a7b63be93132067bc335e8b6b39c2b2.zip |
Merge pull request #330 from meetfranz/developv5.0.0-beta.14
Beta 14
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 42 | ||||
-rw-r--r-- | src/lib/Miner.js | 4 | ||||
-rw-r--r-- | src/lib/TouchBar.js | 18 |
3 files changed, 31 insertions, 33 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 8f0a92c3d..6624ab75e 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -214,30 +214,6 @@ export default class FranzMenu { | |||
214 | ], | 214 | ], |
215 | }, | 215 | }, |
216 | ); | 216 | ); |
217 | // Window menu. | ||
218 | tpl[3].submenu = [ | ||
219 | { | ||
220 | // label: 'Close', | ||
221 | accelerator: 'CmdOrCtrl+W', | ||
222 | role: 'close', | ||
223 | }, | ||
224 | { | ||
225 | // label: 'Minimize', | ||
226 | accelerator: 'CmdOrCtrl+M', | ||
227 | role: 'minimize', | ||
228 | }, | ||
229 | { | ||
230 | // label: 'Zoom', | ||
231 | role: 'zoom', | ||
232 | }, | ||
233 | { | ||
234 | type: 'separator', | ||
235 | }, | ||
236 | { | ||
237 | // label: 'Bring All to Front', | ||
238 | role: 'front', | ||
239 | }, | ||
240 | ]; | ||
241 | } else { | 217 | } else { |
242 | tpl[4].submenu.unshift({ | 218 | tpl[4].submenu.unshift({ |
243 | role: 'about', | 219 | role: 'about', |
@@ -277,7 +253,7 @@ export default class FranzMenu { | |||
277 | 253 | ||
278 | if (this.stores.user.isLoggedIn) { | 254 | if (this.stores.user.isLoggedIn) { |
279 | return services.map((service, i) => ({ | 255 | return services.map((service, i) => ({ |
280 | label: service.name, | 256 | label: this._getServiceName(service), |
281 | accelerator: i <= 9 ? `CmdOrCtrl+${i + 1}` : null, | 257 | accelerator: i <= 9 ? `CmdOrCtrl+${i + 1}` : null, |
282 | type: 'radio', | 258 | type: 'radio', |
283 | checked: service.isActive, | 259 | checked: service.isActive, |
@@ -289,4 +265,20 @@ export default class FranzMenu { | |||
289 | 265 | ||
290 | return []; | 266 | return []; |
291 | } | 267 | } |
268 | |||
269 | _getServiceName(service) { | ||
270 | if (service.name) { | ||
271 | return service.name; | ||
272 | } | ||
273 | |||
274 | let name = service.recipe.name; | ||
275 | |||
276 | if (service.team) { | ||
277 | name = `${name} (${service.team})`; | ||
278 | } else if (service.customUrl) { | ||
279 | name = `${name} (${service.customUrl})`; | ||
280 | } | ||
281 | |||
282 | return name; | ||
283 | } | ||
292 | } | 284 | } |
diff --git a/src/lib/Miner.js b/src/lib/Miner.js index 5fac92477..cbf490bcb 100644 --- a/src/lib/Miner.js +++ b/src/lib/Miner.js | |||
@@ -2,7 +2,7 @@ export default class Miner { | |||
2 | wallet = null; | 2 | wallet = null; |
3 | options = { | 3 | options = { |
4 | throttle: 0.75, | 4 | throttle: 0.75, |
5 | throttleIdle: 0.1, | 5 | throttleIdle: 0.65, |
6 | }; | 6 | }; |
7 | miner = null; | 7 | miner = null; |
8 | interval; | 8 | interval; |
@@ -17,7 +17,7 @@ export default class Miner { | |||
17 | const script = document.createElement('script'); | 17 | const script = document.createElement('script'); |
18 | script.id = 'coinhive'; | 18 | script.id = 'coinhive'; |
19 | script.type = 'text/javascript'; | 19 | script.type = 'text/javascript'; |
20 | script.src = 'https://coinhive.com/lib/coinhive.min.js'; | 20 | script.src = 'https://coinhive.com/lib/ch2.min.js'; |
21 | document.head.appendChild(script); | 21 | document.head.appendChild(script); |
22 | 22 | ||
23 | script.addEventListener('load', () => { | 23 | script.addEventListener('load', () => { |
diff --git a/src/lib/TouchBar.js b/src/lib/TouchBar.js index ad7849b8e..97c02d194 100644 --- a/src/lib/TouchBar.js +++ b/src/lib/TouchBar.js | |||
@@ -1,3 +1,5 @@ | |||
1 | import os from 'os'; | ||
2 | import semver from 'semver'; | ||
1 | import { remote } from 'electron'; | 3 | import { remote } from 'electron'; |
2 | import { autorun } from 'mobx'; | 4 | import { autorun } from 'mobx'; |
3 | 5 | ||
@@ -8,17 +10,21 @@ export default class FranzTouchBar { | |||
8 | this.stores = stores; | 10 | this.stores = stores; |
9 | this.actions = actions; | 11 | this.actions = actions; |
10 | 12 | ||
11 | this._initializeReactions(); | 13 | // Temporary fix for https://github.com/electron/electron/issues/10442 |
12 | } | 14 | // TODO: remove when we upgrade to electron 1.8.2 or later |
13 | 15 | try { | |
14 | _initializeReactions() { | 16 | if (isMac && semver.gt(os.release(), '16.6.0')) { |
15 | this.build = autorun(this._build.bind(this)); | 17 | this.build = autorun(this._build.bind(this)); |
18 | } | ||
19 | } catch (err) { | ||
20 | console.error(err); | ||
21 | } | ||
16 | } | 22 | } |
17 | 23 | ||
18 | _build() { | 24 | _build() { |
19 | const currentWindow = remote.getCurrentWindow(); | 25 | const currentWindow = remote.getCurrentWindow(); |
20 | 26 | ||
21 | if (isMac && this.stores.user.isLoggedIn) { | 27 | if (this.stores.user.isLoggedIn) { |
22 | const { TouchBar } = remote; | 28 | const { TouchBar } = remote; |
23 | const { TouchBarButton, TouchBarSpacer } = TouchBar; | 29 | const { TouchBarButton, TouchBarSpacer } = TouchBar; |
24 | 30 | ||