Browse Source

fix request time out

causefx 8 năm trước cách đây
mục cha
commit
999a9e8c16
1 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 3 4
      js/functions.js

+ 3 - 4
js/functions.js

@@ -2993,7 +2993,7 @@ function homepagePlaylist(type, timeout=30000){
 		console.error("Organizr Function: API Connection Failed");
 	});
 }
-function homepageRequests(timeout=30000){
+function homepageRequests(timeout=600000){
 	ajaxloader(".content-wrap","in");
 	organizrAPI('POST','api/?v1/homepage/connect',{action:'getRequests'}).success(function(data) {
 		var response = JSON.parse(data);
@@ -3056,9 +3056,8 @@ function homepageRequests(timeout=30000){
 		console.error("Organizr Function: API Connection Failed");
 	});
 	ajaxloader();
-	setTimeout(function(){
-		homepageRequests(timeout);
-	}, timeout)
+	if(typeof homepageRequestsTimeout !== 'undefined'){ clearTimeout(homepageRequestsTimeout); }
+	homepageRequestsTimeout = setTimeout(function(){ homepageRequests(timeout); }, timeout)
 }
 function homepageCalendar(timeout=30000){
 	//if(isHidden()){ return; }