This repository has been archived on 2021-06-30 . You can view files and clone it, but cannot push or open issues or pull requests.
2019-02-09 01:34:04 +00:00
require ( 'dotenv' ) . config ( ) ;
const { app , BrowserWindow } = require ( 'electron' ) ;
let win ;
function createWindow ( ) {
2019-05-21 04:58:16 +00:00
win = new BrowserWindow ( { width : 800 , height : 600 , frame : false , webPreferences : { webSecurity : false , nodeIntegration : true } } ) ; //TODO: Please find a better solution for the love of god.
2019-02-09 01:34:04 +00:00
2019-04-01 17:50:15 +00:00
if ( process . env . NODE _ENV === "development" ) win . loadURL ( ` http://localhost: ${ process . env . PORT } ` ) ;
2019-02-09 01:34:04 +00:00
else win . loadFile ( './build/index.html' ) ;
win . webContents . openDevTools ( ) ;
win . on ( 'closed' , ( ) => {
win = null ;
} ) ;
}
app . on ( 'ready' , createWindow ) ;
app . on ( 'window-all-closed' , ( ) => {
if ( process . platform !== 'darwin' ) app . quit ( ) ;
} ) ;
app . on ( 'activate' , ( ) => {
if ( win === null ) createWindow ( ) ;
2019-05-21 04:58:16 +00:00
} ) ;