mirror of
https://github.com/sascha-hemi/homeassistant-desktop.git
synced 2026-03-21 04:06:06 +01:00
added force quit for instant updating
This commit is contained in:
5
app.js
5
app.js
@@ -4,8 +4,6 @@ const AutoLaunch = require('auto-launch');
|
|||||||
const Positioner = require('electron-traywindow-positioner');
|
const Positioner = require('electron-traywindow-positioner');
|
||||||
const Store = require('electron-store');
|
const Store = require('electron-store');
|
||||||
|
|
||||||
const indexFile = `file://${__dirname}/web/index.html`;
|
|
||||||
|
|
||||||
app.allowRendererProcessReuse = true;
|
app.allowRendererProcessReuse = true;
|
||||||
|
|
||||||
// prevent multiple instances
|
// prevent multiple instances
|
||||||
@@ -23,9 +21,11 @@ if (process.platform === 'darwin') app.dock.hide();
|
|||||||
const store = new Store();
|
const store = new Store();
|
||||||
const autoLauncher = new AutoLaunch({name: 'Home Assistant Desktop'});
|
const autoLauncher = new AutoLaunch({name: 'Home Assistant Desktop'});
|
||||||
|
|
||||||
|
const indexFile = `file://${__dirname}/web/index.html`;
|
||||||
let autostartEnabled = false;
|
let autostartEnabled = false;
|
||||||
let forceQuit = false;
|
let forceQuit = false;
|
||||||
|
|
||||||
|
|
||||||
const useAutoUpdater = () => {
|
const useAutoUpdater = () => {
|
||||||
autoUpdater.on('error', message => {
|
autoUpdater.on('error', message => {
|
||||||
console.error('There was a problem updating the application');
|
console.error('There was a problem updating the application');
|
||||||
@@ -33,6 +33,7 @@ const useAutoUpdater = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
autoUpdater.on('update-downloaded', () => {
|
autoUpdater.on('update-downloaded', () => {
|
||||||
|
forceQuit = true;
|
||||||
autoUpdater.quitAndInstall();
|
autoUpdater.quitAndInstall();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/mrvnklm/homeassistant-desktop"
|
"url": "https://github.com/mrvnklm/homeassistant-desktop"
|
||||||
},
|
},
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"description": "Desktop App (Windows / macOS) for Home Assistant built with Electron",
|
"description": "Desktop App (Windows / macOS) for Home Assistant built with Electron",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user