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
1 changed files with 3 additions and 0 deletions

View File

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