Updated getWindow to return electron func
This commit is contained in:
parent
9e04891b2f
commit
2036ab87a0
1 changed files with 6 additions and 2 deletions
|
@ -2,7 +2,7 @@ import * as fs from "fs";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import {Store} from "./store";
|
import {Store} from "./store";
|
||||||
import {BrowserWindow as bw} from "./browserwindow";
|
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 fetch from "electron-fetch";
|
||||||
import {AppImageUpdater, NsisUpdater} from "electron-updater";
|
import {AppImageUpdater, NsisUpdater} from "electron-updater";
|
||||||
import * as log from "electron-log";
|
import * as log from "electron-log";
|
||||||
|
@ -124,7 +124,11 @@ export class utils {
|
||||||
* Gets the browser window
|
* Gets the browser window
|
||||||
*/
|
*/
|
||||||
static getWindow(): Electron.BrowserWindow {
|
static getWindow(): Electron.BrowserWindow {
|
||||||
|
if (bw.win) {
|
||||||
return bw.win
|
return bw.win
|
||||||
|
} else {
|
||||||
|
return BrowserWindow.getAllWindows()[0]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static loadPluginFrontend(path: string): void {
|
static loadPluginFrontend(path: string): void {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue