Updated getWindow to return electron func

This commit is contained in:
Core 2022-06-16 00:34:05 +01:00
parent 9e04891b2f
commit 2036ab87a0
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6

View file

@ -2,7 +2,7 @@ import * as fs from "fs";
import * as path from "path";
import {Store} from "./store";
import {BrowserWindow as bw} from "./browserwindow";
import {app, dialog, ipcMain, Notification, shell } from "electron";
import {app, dialog, ipcMain, Notification, shell, BrowserWindow} from "electron";
import fetch from "electron-fetch";
import {AppImageUpdater, NsisUpdater} from "electron-updater";
import * as log from "electron-log";
@ -124,7 +124,11 @@ export class utils {
* Gets the browser window
*/
static getWindow(): Electron.BrowserWindow {
if (bw.win) {
return bw.win
} else {
return BrowserWindow.getAllWindows()[0]
}
}
static loadPluginFrontend(path: string): void {