Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR] Touch Bar app crash #310

Merged
merged 3 commits into from
Nov 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"react-sortable-hoc": "^0.6.7",
"react-tooltip": "^3.2.7",
"route-parser": "^0.0.5",
"semver": "^5.4.1",
"smoothscroll-polyfill": "^0.3.4",
"tar": "^4.0.2",
"uuid": "^3.0.1"
Expand Down
1 change: 0 additions & 1 deletion src/components/ui/Subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Form from '../../lib/Form';
import Radio from '../ui/Radio';
import Button from '../ui/Button';
import Loader from '../ui/Loader';
import { isWindows } from '../../environment';

import { required } from '../../helpers/validation-helpers';

Expand Down
18 changes: 12 additions & 6 deletions src/lib/TouchBar.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os from 'os';
import semver from 'semver';
import { remote } from 'electron';
import { autorun } from 'mobx';

Expand All @@ -8,17 +10,21 @@ export default class FranzTouchBar {
this.stores = stores;
this.actions = actions;

this._initializeReactions();
}

_initializeReactions() {
this.build = autorun(this._build.bind(this));
// Temporary fix for https://github.com/electron/electron/issues/10442
// TODO: remove when we upgrade to electron 1.8.2 or later
try {
if (isMac && semver.gt(os.release(), '16.6.0')) {
this.build = autorun(this._build.bind(this));
}
} catch (err) {
console.error(err);
}
}

_build() {
const currentWindow = remote.getCurrentWindow();

if (isMac && this.stores.user.isLoggedIn) {
if (this.stores.user.isLoggedIn) {
const { TouchBar } = remote;
const { TouchBarButton, TouchBarSpacer } = TouchBar;

Expand Down