aboutsummaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-07-02 21:31:11 +0200
committerVincent Petry <pvince81@owncloud.com>2014-07-02 21:34:43 +0200
commit012abbad44f91e7318c15d973f97474ba3bfeff5 (patch)
treeabbd3c3d90952e31fa3df5f3ba69d0fb741eed3f /core/js
parented29e7d1606ae073ab156ab1bf086ddec2b94bb3 (diff)
downloadnextcloud-server-012abbad44f91e7318c15d973f97474ba3bfeff5.tar.gz
nextcloud-server-012abbad44f91e7318c15d973f97474ba3bfeff5.zip
Fixed event source fallback after close
Diffstat (limited to 'core/js')
-rw-r--r--core/js/eventsource.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/js/eventsource.js b/core/js/eventsource.js
index ce2a13d4676..7bb23dc44f7 100644
--- a/core/js/eventsource.js
+++ b/core/js/eventsource.js
@@ -35,6 +35,7 @@
*/
OC.EventSource=function(src,data){
var dataStr='';
+ this.closed = false;
this.typelessListeners=[];
this.listeners={};
if(data){
@@ -88,6 +89,10 @@ OC.EventSource.prototype={
listeners:{},//only for fallback
useFallBack:false,
fallBackCallBack:function(type,data){
+ // ignore messages that might appear after closing
+ if (this.closed) {
+ return;
+ }
if(type){
if (typeof this.listeners['done'] != 'undefined') {
for(var i=0;i<this.listeners[type].length;i++){
@@ -125,6 +130,7 @@ OC.EventSource.prototype={
}
},
close:function(){
+ this.closed = true;
if (typeof this.source !='undefined') {
this.source.close();
}