Fix websocket not unlocking when window is closed manually

This commit is contained in:
smartfrigde 2022-04-19 16:10:12 +02:00
parent eda6621989
commit 37966b985a

View file

@ -169,6 +169,9 @@ export default async function startServer() {
lock = false; lock = false;
child.close(); child.close();
}) })
child.on("close", (e) => {
lock = false;
})
// Blocks requests to ArmCord's WS, to prevent loops. // Blocks requests to ArmCord's WS, to prevent loops.
child.webContents.session.webRequest.onBeforeRequest({ child.webContents.session.webRequest.onBeforeRequest({
urls: ['ws://127.0.0.1:'+wsPort.toString()+'/*'] urls: ['ws://127.0.0.1:'+wsPort.toString()+'/*']