Skip to content

Commit

Permalink
use electron-is-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Dec 26, 2016
1 parent 3f8b66f commit 4a9eacd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"configstore": "^2.1.0",
"electron-auto-updater": "^0.8.3",
"electron-debug": "^1.1.0",
"electron-is-dev": "^0.1.2",
"keytar": "^3.0.2",
"nslog": "^3.0.0",
"osascript": "^1.2.0"
Expand Down
9 changes: 4 additions & 5 deletions src/AppMenuManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {WINDOW_NAVIGATED} from "./WindowManager";
import {AppSignal} from "./electronEventSignals";
import MenuItemOptions = Electron.MenuItemOptions
import WebContents = Electron.WebContents
import IpcMainEvent = Electron.IpcMainEvent;

export default function setMenu(homeUrl: string) {
const windowsMenu: MenuItemOptions = {
Expand Down Expand Up @@ -214,10 +213,10 @@ function updateHistoryMenuItems(items: MenuItemOptions[], homeUrl: string) {
items[1].enabled = webContents.canGoForward()
}

ipcMain.on(WINDOW_NAVIGATED, (event: IpcMainEvent, url: string) => {
updateEnabled(event.sender)
items[2].enabled = url.replace(/(\?.*)|(#.*)/g, "") != homeUrl
})
ipcMain.on(WINDOW_NAVIGATED, <any>((webContents: WebContents, url: string) => {
updateEnabled(webContents)
items[2].enabled = url.replace(/(\?.*)|(#.*)/g, "") != homeUrl
}))

new AppSignal()
.windowBlurred(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {app} from "electron";
const _isDev = require('electron-is-dev')

export function isDev() {
return app.getPath("exe").includes("/node_modules/electron-prebuilt/")
return _isDev
}

let _log: (...args: any[]) => void
Expand Down

0 comments on commit 4a9eacd

Please sign in to comment.