Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron >=v4 "makeSingleInstance is not a function", replaced in Electron v4 #277

Open
evan-coygo opened this issue Jul 2, 2020 · 1 comment

Comments

@evan-coygo
Copy link
Contributor

const isSecondInstance = app.makeSingleInstance(() => {

If you have single instance enable the app.makeSingleInstance() function is used but it was replaced in Electron v4, see release notes https://www.electronjs.org/blog/electron-4-0. app.requestSingleInstanceLock() should be used instead

@evan-coygo
Copy link
Contributor Author

In the meantime anyone who stumbles on this can fix this yourself by just setting "singleInstance" to false in .desktop/settings.json, then adding this in your .desktop/desktop.js constructor() method:

    // ensure only a single instance of the app can be run
    const gotTheLock = app.requestSingleInstanceLock();
    if (!gotTheLock) {
      return app.quit();
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant