🐛 handle proxy auth window closing

This commit is contained in:
Joao Moreno
2017-04-13 21:49:09 +02:00
parent 9396dd4bb8
commit bf7c48e9a7

View File

@@ -77,8 +77,13 @@ export class ProxyAuthHandler {
const javascript = 'promptForCredentials(' + JSON.stringify(data) + ')';
event.preventDefault();
const onWindowClose = () => cb('', '');
win.on('close', onWindowClose);
win.webContents.executeJavaScript(javascript, true).then(({ username, password }: Credentials) => {
cb(username, password);
win.removeListener('close', onWindowClose);
win.close();
});
}