Skip to content

Commit

Permalink
fix: block closing controller window while processing
Browse files Browse the repository at this point in the history
  • Loading branch information
xpadev-net committed Nov 21, 2023
1 parent c52d3a6 commit 6708324
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions electron/controllerWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as path from "path";
import type { ApiResponsesToController } from "@/@types/response.controller";

import { baseUrl } from "./context";
import { processingQueue } from "./queue";

let controllerWindow: BrowserWindow;
const createControllerWindow = (): void => {
Expand All @@ -17,6 +18,12 @@ const createControllerWindow = (): void => {
},
});
controllerWindow.removeMenu();
controllerWindow.on("close", (e) => {
if (processingQueue?.status === "processing") {
e.preventDefault();
return;
}
});

const appURL = `${baseUrl}`;

Expand Down

0 comments on commit 6708324

Please sign in to comment.