4 ms·
We are working with electron, and make a simple solution for starting app, if already, Just create new entry point, in this entry, dont do anything except check
by tuanh1805 9y ago
We are working with electron, and make a simple solution for starting app, if already,
Just create new entry point, in this entry, dont do anything except check the makeSingleInstance function
If an instance already alive => just quit :D
It's make our app seem very fast
const app = require('electron').app;
const shouldQuit = app.makeSingleInstance((argv, workingDirectory) => { });
if(shouldQuit){
app.quit()
}else{
app.on('ready', ()=>{
require('./startUp')
})
}