You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When open vaccinate.db is called, a new app instance will launch – one of the initial steps should be to call app.requestSingleInstanceLock() which:
returns true if your process is the primary instance of your application and your app should continue loading.
returns false if your process should immediately quit as it has sent its parameters to another instance that has already acquired the lock.
Our scenario where an instance of the app is already open should return false, and the second-instance event should be fired (and the primary instance of the app should handle the event accordingly):
app.on('second-instance',(event,commandLine,workingDirectory)=>{// handle event here to re-focus existing open window})
If the file is already open, we can simply re-focus the window – if a new file is being called using open (rather than within the app), then we can open a new window accordingly.
I found out today that running this opens the database in Datasette Desktop, which is really cool!
But... if you then run the same command a second time you get the following error:
It would be better if it ignored the error and instead opened a window for that database - or re-focused a window if one was already open somewhere.
The text was updated successfully, but these errors were encountered: