Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix(menu): move update check execution in to the main process
Browse files Browse the repository at this point in the history
  • Loading branch information
Lasse Küchler authored and lkuechler committed Jan 13, 2018
1 parent c0725a6 commit 7f8ce94
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/electron/electron.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { checkForUpdates } from './auto-updater';
import { app, BrowserWindow } from 'electron';
import { app, BrowserWindow, ipcMain } from 'electron';
import * as PathUtils from 'path';
import * as url from 'url';

Expand Down Expand Up @@ -85,3 +85,9 @@ app.on('activate', () => {
createWindow();
}
});

ipcMain.on('request-check-for-updates', () => {
if (win) {
checkForUpdates(win);
}
});
12 changes: 9 additions & 3 deletions src/electron/menu.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { checkForUpdates } from './auto-updater';
import { BrowserWindow, MenuItem, MenuItemConstructorOptions, remote, WebContents } from 'electron';
import {
BrowserWindow,
ipcRenderer,
MenuItem,
MenuItemConstructorOptions,
remote,
WebContents
} from 'electron';
import * as FileExtraUtils from 'fs-extra';
import { PageElement } from '../store/page/page_element';
import * as PathUtils from 'path';
Expand Down Expand Up @@ -279,7 +285,7 @@ export function createMenu(store: Store): void {
{
label: 'Check for Updates',
click: () => {
checkForUpdates(remote.getCurrentWindow());
ipcRenderer.send('request-check-for-updates');
}
},
{
Expand Down

0 comments on commit 7f8ce94

Please sign in to comment.