store window ref globally so when splitting files its easier to access.
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
53e2ce33b8
commit
b6d2ba2019
3 changed files with 15 additions and 21 deletions
|
@ -67,17 +67,11 @@ module.exports.start = function startAutoUpdate(updateBaseUrl) {
|
|||
}
|
||||
|
||||
ipcMain.on('install_update', installUpdate);
|
||||
|
||||
let ipcChannel;
|
||||
ipcMain.on('check_updates', function(event) {
|
||||
ipcChannel = event.sender;
|
||||
pollForUpdates();
|
||||
// event.sender.send('check_updates') // true/false/error = available(downloading)/notAvailable/error
|
||||
});
|
||||
ipcMain.on('check_updates', pollForUpdates);
|
||||
|
||||
function ipcChannelSendUpdateStatus(status) {
|
||||
if (ipcChannel) {
|
||||
ipcChannel.send('check_updates', status);
|
||||
if (global.mainWindow) {
|
||||
global.mainWindow.webContents.send('check_updates', status);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue