Commit 489e5cf2 authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix auto update

parent 454228bc
...@@ -14,7 +14,7 @@ declare const $: any; ...@@ -14,7 +14,7 @@ declare const $: any;
export class MyCardComponent implements OnInit { export class MyCardComponent implements OnInit {
currentPage: string = "lobby"; currentPage: string = "lobby";
update_status: string | undefined; update_status: string | undefined = remote.getGlobal('update_status');
update_error: string | undefined; update_error: string | undefined;
currentWindow = remote.getCurrentWindow(); currentWindow = remote.getCurrentWindow();
window = window; window = window;
......
...@@ -74,18 +74,23 @@ if (process.env['NODE_ENV'] == 'production' && process.platform == 'darwin') { ...@@ -74,18 +74,23 @@ if (process.env['NODE_ENV'] == 'production' && process.platform == 'darwin') {
// }, 6000) // }, 6000)
// } // }
autoUpdater.on('error', (event) => { autoUpdater.on('error', (event) => {
global.update_status = 'error';
console.log('autoUpdater', 'error', event); console.log('autoUpdater', 'error', event);
}); });
autoUpdater.on('checking-for-update', () => { autoUpdater.on('checking-for-update', () => {
global.update_status = 'checking-for-update';
console.log('autoUpdater', 'checking-for-update'); console.log('autoUpdater', 'checking-for-update');
}); });
autoUpdater.on('update-available', () => { autoUpdater.on('update-available', () => {
global.update_status = 'update-available';
console.log('autoUpdater', 'update-available'); console.log('autoUpdater', 'update-available');
}); });
autoUpdater.on('update-not-available', () => { autoUpdater.on('update-not-available', () => {
global.update_status = 'update-not-available';
console.log('autoUpdater', 'update-not-available'); console.log('autoUpdater', 'update-not-available');
}); });
autoUpdater.on('update-downloaded', (event) => { autoUpdater.on('update-downloaded', (event) => {
global.update_status = 'update-downloaded';
console.log('autoUpdater', 'update-downloaded', event); console.log('autoUpdater', 'update-downloaded', event);
updateWindow = new BrowserWindow({ updateWindow = new BrowserWindow({
width: 640, width: 640,
...@@ -180,7 +185,7 @@ function createTray() { ...@@ -180,7 +185,7 @@ function createTray() {
app.on('ready', () => { app.on('ready', () => {
createWindow(); createWindow();
if (process.env['NODE_ENV'] == 'production') { if (process.env['NODE_ENV'] == 'production') {
setTimeout(autoUpdater.checkForUpdates, 2000); autoUpdater.checkForUpdates()
} }
if (process.platform == 'win32') { if (process.platform == 'win32') {
createTray() createTray()
......
{ {
"name": "mycard", "name": "mycard",
"version": "3.0.0-dev.15", "version": "3.0.0-dev.16",
"description": "mycard", "description": "mycard",
"keywords": [], "keywords": [],
"author": "zh99998 <zh99998@gmail.com>", "author": "zh99998 <zh99998@gmail.com>",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment