[FIX] bus: prevent error popups when longpolling requests are interrupted

1b9c404 modified the /longpolling/poll requests
to use openerp.session.rpc() instead of openerp.jsonRpc().
In order to properly disable error popups, an
explicit preventDefault() call is now required.
This commit is contained in:
Olivier Dony 2014-09-22 19:13:41 +02:00
parent 152c5c2b56
commit 4614fdf755
1 changed files with 2 additions and 0 deletions

View File

@ -33,6 +33,8 @@
self.poll();
}
}, function(unused, e) {
// no error popup if request is interrupted or fails for any reason
e.preventDefault();
// random delay to avoid massive longpolling
setTimeout(_.bind(self.poll, self), bus.ERROR_DELAY + (Math.floor((Math.random()*20)+1)*1000));
});