@ -187,7 +187,7 @@ function createWindow () {
mainWindow . minimize ( ) ;
mainWindow . minimize ( ) ;
break ;
break ;
case 'quit' :
case 'quit' :
app . qu it( ) ;
app . ex it( ) ;
break ;
break ;
}
}
break ;
break ;
@ -324,15 +324,15 @@ const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => {
} ) ;
} ) ;
if ( shouldQuit ) {
if ( shouldQuit ) {
app . qu it( ) ;
app . ex it( ) ;
}
}
// Code for downloading images as temporal files
// Code for downloading images as temporal files
// Credit: Ghetto Skype (https://github.com/stanfieldr/ghetto-skype)
// Credit: Ghetto Skype (https://github.com/stanfieldr/ghetto-skype)
const tmp = require ( 'tmp' ) ;
const mime = require ( 'mime' ) ;
var imageCache = { } ;
var imageCache = { } ;
ipcMain . on ( 'image:download' , function ( event , url , partition ) {
ipcMain . on ( 'image:download' , function ( event , url , partition ) {
const tmp = require ( 'tmp' ) ;
const mime = require ( 'mime' ) ;
let file = imageCache [ url ] ;
let file = imageCache [ url ] ;
if ( file ) {
if ( file ) {
if ( file . complete ) {
if ( file . complete ) {
@ -449,7 +449,7 @@ app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
// to stay active until the user quits explicitly with Cmd + Q
if ( process . platform !== 'darwin' ) {
if ( process . platform !== 'darwin' ) {
app . qu it( ) ;
app . ex it( ) ;
}
}
} ) ;
} ) ;