Skip to content
Merged

0.9.2 #371

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ email_*/build
*/src/app/build/
electron_app/build/Certificates.p12
electron_app/build/Criptext_Mail_Distribution.provisionprofile
electron_app/dev-app-update.yml

# misc
*/.env*
Expand Down
6 changes: 5 additions & 1 deletion electron_app/electron-starter.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,8 @@ app.on('window-all-closed', () => {

app.on("activate", () => {
mailboxWindow.show();
})
})

app.on('before-quit', function() {
globalManager.forcequit.set(true);
});
2 changes: 1 addition & 1 deletion electron_app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "criptext",
"version": "0.9.0",
"version": "0.9.2",
"author": {
"name": "Criptext Inc.",
"email": "info@criptext.com",
Expand Down
12 changes: 12 additions & 0 deletions electron_app/src/globalManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ const getModalData = () => {
return global.modalData;
};

// Force quit
const setForceQuit = data => {
global.forcequit = data;
};
const getForceQuit = () => {
return global.forcequit;
};

// Loading
const setLoadingData = data => {
global.loadingData = data;
Expand Down Expand Up @@ -46,6 +54,10 @@ module.exports = {
get: getEmailToEdit,
set: setEmailToEdit
},
forcequit: {
get: getForceQuit,
set: setForceQuit
},
loadingData: {
get: getLoadingData,
set: setLoadingData
Expand Down
6 changes: 5 additions & 1 deletion electron_app/src/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { dialog } = require('electron');
const { autoUpdater } = require('electron-updater');
const notifier = require('node-notifier');
const path = require('path');
const globalManager = require('./globalManager');
const appId = 'com.criptext.criptextmail';

let currentUpdaterType;
Expand Down Expand Up @@ -102,7 +103,10 @@ autoUpdater.on('update-downloaded', () => {
() => {
currentUpdaterType = updaterTypes.NONE;
isDownloadingUpdate = false;
setImmediate(() => autoUpdater.quitAndInstall());
setImmediate(() => {
globalManager.forcequit.set(true);
autoUpdater.quitAndInstall();
});
}
);
});
Expand Down
7 changes: 4 additions & 3 deletions electron_app/src/windows/mailbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ const { app, BrowserWindow, shell } = require('electron');
const windowStateManager = require('electron-window-state');
const { mailboxUrl } = require('./../window_routing');
const { appUpdater } = require('./../updater');
const globalManager = require('./../globalManager');
const path = require('path');
const opn = require('opn');

let mailboxWindow;
let force_quit = false;
globalManager.forcequit.set(false);

const mailboxSize = {
width: 1400,
Expand Down Expand Up @@ -40,7 +41,7 @@ const create = () => {
ev.preventDefault();
});
mailboxWindow.on('close', e => {
if (process.platform === 'darwin' && !force_quit) {
if (!globalManager.forcequit.get()) {
e.preventDefault();
mailboxWindow.hide();
}
Expand Down Expand Up @@ -124,7 +125,7 @@ const openLinkInDefaultBrowser = (ev, url) => {
};

const quit = () => {
force_quit = true;
globalManager.forcequit.set(true);
app.quit();
};

Expand Down
2 changes: 1 addition & 1 deletion email_mailbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "email_mailbox",
"version": "0.9.0",
"version": "0.9.2",
"private": true,
"dependencies": {
"animejs": "^2.2.0",
Expand Down