desktop-application


electron makeSingleInstance not restoring app


const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.show()
mainWindow.focus()
}
})
if (shouldQuit) {
app.quit()
}
this is what i am trying,
But when one instance of app is open it do not open new instance(which is correct),but is not restoring the current instance(which is Minimized)
Any idea?
i got feeling that it is not going into if(mainWindow) condition but why?
This example is given in there official document also?
Thanks in advance.
I had to use app.on('activate', () => { window.show() } to get it to reshow the app.
When trying to make makeSingleInstance work, was getting Error: Object has been destroyed untill i added return after app.quit():
if (shouldQuit) {
app.quit()
return // super important
}
Credits: dominikfiala comment

Related Links

My app passed windows app certification test with warnings,will I be able to publish it on the windows store
HTML/CSS/JS desktop application runtime for RHEL6
How can I make offline maps for Windows Desktop Application using Mapbox
Connect Production server sql database from my desktop application
softphone pbx software creation [closed]
How do I correctly ship licenses with my desktop app?
TideSDK: Download mp3 files
How to login to OWIN Web Api 2 WS-Federation server from desktop app
How to inspect elements in a desktop application?
IBM Worklight - Can we create a desktop based application?
How to capture traffic of Desktop Application Using Fiddler
How to write a program that starts or pops every time I unlock my computer?
Steps to Create a Signed Desktop App for Windows 8?
Developing an Offline Native Application from a Web Dev background [closed]
Is libGDX suited for desktop-only application development?
UltraWinToolbars Control is not working in new version 12.2

Categories

HOME
drupal
repository
twitter-bootstrap
azure-documentdb
itunesconnect
singleton
terminal
perl6
vsixmanifest
dcos
theory
vichuploaderbundle
decoding
popup
loss
smooth-scrolling
cucumberjs
wallet
passbook
git-branch
screen-scraping
email-client
policy
windowserror
core-animation
inspec
tftp
dynamics-ax-2012-r3
semantic-ui-react
opencsv
jql
ng2-bootstrap
webspeech-api
offset
intersection
pymunk
strategy-pattern
anypoint-studio
matrix-multiplication
linkurious
ninja-forms
susy
peerjs
superclass
pexpect
scrapinghub
gradlew
logan-square
ocamlbuild
stanford-nlp-server
google-cloud-shell
skype-bots
aws-rds
webmatrix
senti-wordnet
overhead
wicketstuff
therubyracer
turbolinks
konakart
mate-desktop
scriptengine
key-value-store
syslog4j
qtruby
methodology
wordpress-plugin
play-json
adempiere
openhab
winforms-interop
firewire
waterline
teamwork
sicstus-prolog
beagleboard
asp.net-2.0
chrome-mobile
data-quality-services
touch-typing
quickfixn
crystal-reports-7
clearcanvas
system.net
episerver-7
dateadd
email-headers
class-library
data-layers
complete
maven-javadoc-plugin
tlbimp
ia-32
leap-year
mosix
auctex
database-restore
libx264
freeimage
expresso-store
certificate-revocation
virtual-printer
pex-and-moles
file-processing
sessiontracking
cinder
file-icons
disk-based
hotfix

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App