Skip to content

Commit 3279ca7

Browse files
author
Erika Perugachi
authored
Merge pull request #371 from erikaperugachi/9.2
0.9.2
2 parents 0b3b94a + d7749f9 commit 3279ca7

File tree

7 files changed

+29
-7
lines changed

7 files changed

+29
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ email_*/build
1616
*/src/app/build/
1717
electron_app/build/Certificates.p12
1818
electron_app/build/Criptext_Mail_Distribution.provisionprofile
19+
electron_app/dev-app-update.yml
1920

2021
# misc
2122
*/.env*

electron_app/electron-starter.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,8 @@ app.on('window-all-closed', () => {
126126

127127
app.on("activate", () => {
128128
mailboxWindow.show();
129-
})
129+
})
130+
131+
app.on('before-quit', function() {
132+
globalManager.forcequit.set(true);
133+
});

electron_app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "criptext",
3-
"version": "0.9.0",
3+
"version": "0.9.2",
44
"author": {
55
"name": "Criptext Inc.",
66
"email": "[email protected]",

electron_app/src/globalManager.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ const getModalData = () => {
1111
return global.modalData;
1212
};
1313

14+
// Force quit
15+
const setForceQuit = data => {
16+
global.forcequit = data;
17+
};
18+
const getForceQuit = () => {
19+
return global.forcequit;
20+
};
21+
1422
// Loading
1523
const setLoadingData = data => {
1624
global.loadingData = data;
@@ -46,6 +54,10 @@ module.exports = {
4654
get: getEmailToEdit,
4755
set: setEmailToEdit
4856
},
57+
forcequit: {
58+
get: getForceQuit,
59+
set: setForceQuit
60+
},
4961
loadingData: {
5062
get: getLoadingData,
5163
set: setLoadingData

electron_app/src/updater.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const { dialog } = require('electron');
22
const { autoUpdater } = require('electron-updater');
33
const notifier = require('node-notifier');
44
const path = require('path');
5+
const globalManager = require('./globalManager');
56
const appId = 'com.criptext.criptextmail';
67

78
let currentUpdaterType;
@@ -102,7 +103,10 @@ autoUpdater.on('update-downloaded', () => {
102103
() => {
103104
currentUpdaterType = updaterTypes.NONE;
104105
isDownloadingUpdate = false;
105-
setImmediate(() => autoUpdater.quitAndInstall());
106+
setImmediate(() => {
107+
globalManager.forcequit.set(true);
108+
autoUpdater.quitAndInstall();
109+
});
106110
}
107111
);
108112
});

electron_app/src/windows/mailbox.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ const { app, BrowserWindow, shell } = require('electron');
22
const windowStateManager = require('electron-window-state');
33
const { mailboxUrl } = require('./../window_routing');
44
const { appUpdater } = require('./../updater');
5+
const globalManager = require('./../globalManager');
56
const path = require('path');
67
const opn = require('opn');
78

89
let mailboxWindow;
9-
let force_quit = false;
10+
globalManager.forcequit.set(false);
1011

1112
const mailboxSize = {
1213
width: 1400,
@@ -40,7 +41,7 @@ const create = () => {
4041
ev.preventDefault();
4142
});
4243
mailboxWindow.on('close', e => {
43-
if (process.platform === 'darwin' && !force_quit) {
44+
if (!globalManager.forcequit.get()) {
4445
e.preventDefault();
4546
mailboxWindow.hide();
4647
}
@@ -124,7 +125,7 @@ const openLinkInDefaultBrowser = (ev, url) => {
124125
};
125126

126127
const quit = () => {
127-
force_quit = true;
128+
globalManager.forcequit.set(true);
128129
app.quit();
129130
};
130131

email_mailbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "email_mailbox",
3-
"version": "0.9.0",
3+
"version": "0.9.2",
44
"private": true,
55
"dependencies": {
66
"animejs": "^2.2.0",

0 commit comments

Comments
 (0)