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

fix auto update

parent 454228bc
......@@ -14,7 +14,7 @@ declare const $: any;
export class MyCardComponent implements OnInit {
currentPage: string = "lobby";
update_status: string | undefined;
update_status: string | undefined = remote.getGlobal('update_status');
update_error: string | undefined;
currentWindow = remote.getCurrentWindow();
window = window;
......
......@@ -74,18 +74,23 @@ if (process.env['NODE_ENV'] == 'production' && process.platform == 'darwin') {
// }, 6000)
// }
autoUpdater.on('error', (event) => {
global.update_status = 'error';
console.log('autoUpdater', 'error', event);
});
autoUpdater.on('checking-for-update', () => {
global.update_status = 'checking-for-update';
console.log('autoUpdater', 'checking-for-update');
});
autoUpdater.on('update-available', () => {
global.update_status = 'update-available';
console.log('autoUpdater', 'update-available');
});
autoUpdater.on('update-not-available', () => {
global.update_status = 'update-not-available';
console.log('autoUpdater', 'update-not-available');
});
autoUpdater.on('update-downloaded', (event) => {
global.update_status = 'update-downloaded';
console.log('autoUpdater', 'update-downloaded', event);
updateWindow = new BrowserWindow({
width: 640,
......@@ -180,7 +185,7 @@ function createTray() {
app.on('ready', () => {
createWindow();
if (process.env['NODE_ENV'] == 'production') {
setTimeout(autoUpdater.checkForUpdates, 2000);
autoUpdater.checkForUpdates()
}
if (process.platform == 'win32') {
createTray()
......
{
"name": "mycard",
"version": "3.0.0-dev.15",
"version": "3.0.0-dev.16",
"description": "mycard",
"keywords": [],
"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