Verified Commit 5d289897 authored by Camil Staps's avatar Camil Staps 🚀

Prevent loop in close messages

parent d9e4eb88
......@@ -48,6 +48,8 @@ class Component {
this.message_queue=[];
this.shared_clean_values=null;
this.do_debug=false;
this.closing=false;
this.closeWindowOnClose=true;
this.response_handlers=new Map();
......@@ -71,6 +73,11 @@ class Component {
}
tearDown () {
if (this.closing){
if (this.closeWindowOnClose && typeof window!='undefined')
window.close();
return;
}
this.send ('close','');
}
......@@ -94,6 +101,7 @@ class Component {
this.abc.interpret (this.response_handlers.get (data.id),[data.val]);
break;
case 'close':
this.closing=true;
if (this.closeWindowOnClose && typeof window!='undefined')
window.close();
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment