Merge pull request #366 from Zagrios/bugfix/error-on-closing-oneclick-window-when-downloading

[bugfix] Error when closing oneclick download window while still downloading
This commit is contained in:
MathieuG-P
2023-12-01 02:20:57 +01:00
committed by GitHub
+2
View File
@@ -39,6 +39,7 @@ export class IpcService {
}
public send<T>(channel: string, window: BrowserWindow, response?: T | Error): void {
if(window.webContents?.isDestroyed()){ return; }
window.webContents?.send(channel, response);
}
@@ -53,6 +54,7 @@ export class IpcService {
complete: () => this.send(this.getCompleteChannel(channel), window)
})
window.webContents.once("destroyed", () => sub.unsubscribe());
window.webContents.ipc.once(this.getTearDownChannel(channel), () => sub.unsubscribe());
sub.add(() => {