aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/TouchBar.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/TouchBar.js')
-rw-r--r--src/lib/TouchBar.js18
1 files changed, 12 insertions, 6 deletions
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