fix get main window from windows service

This commit is contained in:
MathieuG-P
2022-12-28 20:39:11 +01:00
parent 0cc5f8cbb1
commit df166f3dd0
2 changed files with 8 additions and 1 deletions
+4 -1
View File
@@ -8,6 +8,7 @@ import { InstallationLocationService } from "./installation-location.service";
import { ctrlc } from "ctrlc-windows";
import { BSLocalVersionService } from "./bs-local-version.service";
import isOnline from 'is-online';
import { WindowManagerService } from "./window-manager.service";
export class BSInstallerService{
@@ -16,6 +17,7 @@ export class BSInstallerService{
private readonly utils: UtilsService;
private readonly installLocationService: InstallationLocationService;
private readonly localVersionService: BSLocalVersionService;
private readonly windows: WindowManagerService;
private downloadProcess: ChildProcessWithoutNullStreams;
@@ -23,8 +25,9 @@ export class BSInstallerService{
this.utils = UtilsService.getInstance();
this.installLocationService = InstallationLocationService.getInstance();
this.localVersionService = BSLocalVersionService.getInstance();
this.windows = WindowManagerService.getInstance();
this.utils.getMainWindow().on("close", () => {
this.windows.getWindows("index.html").on("close", () => {
this.killDownloadProcess();
});
}
@@ -75,4 +75,8 @@ export class WindowManagerService{
});
}
public getWindows(window: AppWindow): BrowserWindow{
return this.windows.get(window);
}
}