File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 65
65
"react-sortable-hoc" : " ^0.6.7" ,
66
66
"react-tooltip" : " ^3.2.7" ,
67
67
"route-parser" : " ^0.0.5" ,
68
+ "semver" : " ^5.4.1" ,
68
69
"smoothscroll-polyfill" : " ^0.3.4" ,
69
70
"tar" : " ^4.0.2" ,
70
71
"uuid" : " ^3.0.1"
Original file line number Diff line number Diff line change
1
+ import os from 'os' ;
2
+ import semver from 'semver' ;
1
3
import { remote } from 'electron' ;
2
4
import { autorun } from 'mobx' ;
3
5
@@ -8,17 +10,23 @@ export default class FranzTouchBar {
8
10
this . stores = stores ;
9
11
this . actions = actions ;
10
12
11
- this . _initializeReactions ( ) ;
12
- }
13
-
14
- _initializeReactions ( ) {
15
- this . build = autorun ( this . _build . bind ( this ) ) ;
13
+ // Temporary fix for https://github.com/electron/electron/issues/10442
14
+ // TODO: remove when we upgrade to electron 1.8.2 or later
15
+ try {
16
+ if ( isMac && semver . gt ( os . release ( ) , '16.6.0' ) ) {
17
+ this . build = autorun ( this . _build . bind ( this ) ) ;
18
+ }
19
+ } catch ( err ) {
20
+ console . error ( err ) ;
21
+ }
16
22
}
17
23
18
24
_build ( ) {
19
25
const currentWindow = remote . getCurrentWindow ( ) ;
20
26
21
- if ( isMac && this . stores . user . isLoggedIn ) {
27
+ currentWindow . _setEscapeTouchBarItem = ( ) => { } ;
28
+
29
+ if ( this . stores . user . isLoggedIn ) {
22
30
const { TouchBar } = remote ;
23
31
const { TouchBarButton, TouchBarSpacer } = TouchBar ;
24
32
You can’t perform that action at this time.
0 commit comments