Electron-142 - Fixes the issue where it prevents creating multiple instances of the about window

This commit is contained in:
Kiran Niranjan 2017-10-06 16:47:55 +05:30 committed by Kiran Niranjan
parent b264331a54
commit bb5ace404b

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 });