Skip to content

Commit

Permalink
fix: another attempt to quit properly for update
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Feb 26, 2021
1 parent 4ab47a6 commit 4fd80ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/app-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@pledger/app-electron",
"productName": "Pledger",
"private": true,
"version": "0.2.5",
"version": "0.2.6-dev0",
"description": "Agoric Pledger Wallet",
"main": "./src/entrypoint.cjs",
"repository": "https+git://github.com/agoric-labs/Pledger",
Expand Down
16 changes: 6 additions & 10 deletions packages/app-electron/src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '@agoric/install-ses';
import { makeCapTP, E } from '@agoric/captp';
import { app, BrowserWindow, Menu, shell, Tray } from 'electron';
import { app, autoUpdater, BrowserWindow, Menu, shell, Tray } from 'electron';
import path from 'path';

const WALLET_PORT = 8000;
Expand Down Expand Up @@ -120,19 +120,15 @@ async function main(args, isProduction) {
// app.on('ready', createWindow);
app.on('ready', createTray);

// Quit when all windows are closed, except on macOS. There, it's common for
// applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
//
// NOTE(michaelfig): We don't do this because we want the system tray to stay
// alive on all platforms, unless explicitly quit.
/*
// We have a tray that we want to stay active until the user quits
// explicitly with Cmd + Q, or there is an auto-update.
let installingUpdate = false;
autoUpdater.on('before-quit-for-update', () => installingUpdate = true);
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
if (installingUpdate) { // || process.platform !== 'darwin'
app.quit();
}
});
*/

app.on('activate', () => {
// On OS X it's common to re-create a window in the app when the
Expand Down

0 comments on commit 4fd80ad

Please sign in to comment.