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

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
SoundCloud Desktop Sharing Kit Broken?
Where is my MPI job running?
Replace new version of infragistic controls with old version of infragistic controls
What happens when an application (desktop/game) hangs or it is forced to be closed, or when electricity fails?

Categories

HOME
spring-boot
logging
repository
ldap
formatting
microcontroller
azure-resource-manager
salesforce-lightning
pandoc
google-docs-api
download
terminal
psexec
atlassian-fisheye
open-search-server
android-webview
sahi
ejb-3.0
select2
core-data
ndepend
dynamics-crm-2011
http-status-codes
ng2-charts
repeater
aggregate
exchange-transport-agents
alert
google-calendar-api3
civicrm
conditional-formatting
custom-component
gomobile
formulas
klipfolio
oracle-golden-gate
pumping-lemma
uipath
waterfall
rancher
jopendocument
formtastic
cloudformation
typeclass
windows-10-mobile
osgi-bundle
folder
apm
language-detection
storefront
node-soap
machine-code
flex3
iterm2
ngrok
pyexcel
vpython
peerjs
superclass
wufoo
audio-fingerprinting
vertex
sharpssh
multi-targeting
google-scholar
settext
tinybox2
git-cherry-pick
weblogic-maven-plugin
cexception
calc
askbot
ruby-1.8.7
play-json
gitk
self-join
updating
cloud-storage
callfire
web-standards
genome
google-experiments
dockerpy
chunks
teamstudio-unplugged
information-hiding
powerpoint-2010
traceur
iwork
slimscroll
complete
ardor3d
scidb
sygic
octokit
angularjs-select2
panelgrid
nsautoreleasepool
magicsuggest
gwt2
auctex
moonscript
esi
report-viewer2010
beep
unordered-set
idtabs
copyfile
gmagick
cryptolicensing
chars
google-local-search
xslt-grouping
large-data-volumes
pkcs#7
rpxnow
jgrowl
paperless

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