Merge pull request #203 from KiranNiranjan/ELECTRON-142

Electron-142 (Prevents multiple instances of about window)
This commit is contained in:
Vikas Shashidhar 2017-10-09 15:41:29 +05:30 committed by GitHub
commit 124b705075

View File

@ -44,6 +44,16 @@ function getTemplatePath() {
* which this window should show
*/
function openAboutWindow(windowName) {
// This prevents creating multiple instances of the
// about window
if (aboutWindow) {
if (aboutWindow.isMinimized()) {
aboutWindow.restore();
}
aboutWindow.focus();
return;
}
let allWindows = BrowserWindow.getAllWindows();
allWindows = allWindows.find((window) => { return window.winName === windowName });