mirror of
https://github.com/netzbegruenung/jitsi-meet-electron.git
synced 2024-05-11 04:56:11 +02:00
Force single instance application
This commit is contained in:
parent
fae2c069b3
commit
26b55c7559
24
main.js
24
main.js
|
@ -42,6 +42,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.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue