Skip to content

Commit

Permalink
Use proxy insted of Array.observe, bump electron version
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaa123 committed Jun 13, 2016
1 parent 7236f2c commit 841eefc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
'use strict';
const path = require('path');
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const globalShortcut = electron.globalShortcut;
const ipc = electron.ipcMain;
const Tray = electron.Tray;
const Menu = electron.Menu;
const path = require('path');
const dataStore = require('./src/data-store');

// Show debug tools in debugging mode.
if (dataStore.debug()) {
require('electron-debug')({showDevTools: true});
}

const rulers = [];
let rulers;
let settingsWindow;
let helpWindow;
let lastFocusedRuler;
Expand Down Expand Up @@ -206,8 +206,12 @@ function setup() {
Menu.setApplicationMenu(appMenu);

// We observe changes on the `rulers` array to enable/disable the toggle menu.
Array.observe(rulers, () => {
toggleRulersMenu.enabled = Boolean(rulers.length);
rulers = new Proxy([], { // eslint-disable-line
set(target, property, value) {
target[property] = value;
toggleRulersMenu.enabled = Boolean(target.length);
return true;
}
});

globalShortcut.register('Command + Control + T', toggleRulerCommand);
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "xo",
"start": "electron main.js",
"debug": "electron main.js --debug",
"package": "electron-packager . linear --platform=darwin --arch=all --version=0.35.4 --icon=src/assets/images/lrMacIcon.icns --out=dist --overwrite"
"package": "electron-packager . linear --platform=darwin --arch=all --version=1.2.2 --icon=src/assets/images/lrMacIcon.icns --out=dist --overwrite"
},
"repository": {
"type": "git",
Expand All @@ -22,8 +22,8 @@
"license": "MIT",
"homepage": "http://mikaa123.github.io/linear-website/",
"devDependencies": {
"electron-packager": "^5.1.1",
"electron-prebuilt": "^0.35.0",
"electron-packager": "^7.0.3",
"electron-prebuilt": "^1.2.2",
"xo": "^0.13.0"
},
"dependencies": {
Expand Down

0 comments on commit 841eefc

Please sign in to comment.