diff options
author | akshitkrnagpal <akshitkrnagpal@gmail.com> | 2018-07-12 03:53:40 +0530 |
---|---|---|
committer | Saúl Ibarra Corretgé <s@saghul.net> | 2018-07-15 08:24:54 +0200 |
commit | 26b55c75599b10a0d83681de815920554b7a6ddc (patch) | |
tree | bf649739c7b8a2d55f57757402bd20efeb0976c6 /main.js | |
parent | fae2c069b38618ac9b3c9b5b121387e91fedecb2 (diff) |
Force single instance application
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -43,6 +43,30 @@ const indexURL = URL.format({ let jitsiMeetWindow = null; /** + * Force Single Instance Application + */ +const isSecondInstance = APP.makeSingleInstance(() => { + /** + * If someone creates second instance of the application, set focus on + * existing window. + */ + if (jitsiMeetWindow) { + if (jitsiMeetWindow.isMinimized()) { + jitsiMeetWindow.restore(); + } + jitsiMeetWindow.focus(); + } +}); + +/** + * We should quit the second instance. + */ +if (isSecondInstance) { + APP.quit(); + process.exit(0); +} + +/** * Sets the APP object listeners. */ function setAPPListeners() { |