From 2c07e7668402bc4c74748f7d5a20556e345cadb5 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 26 May 2018 16:16:32 +0200 Subject: [PATCH] Reduce traffic --- assets/js/pages/userPage/posts.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/js/pages/userPage/posts.js b/assets/js/pages/userPage/posts.js index d85ccf28..71c09dee 100644 --- a/assets/js/pages/userPage/posts.js +++ b/assets/js/pages/userPage/posts.js @@ -107,6 +107,12 @@ ComunicWeb.pages.userPage.posts = { //Unlock posts loading ComunicWeb.pages.userPage.posts._load_post_locked = false; + //Lock posts loading, if not any post has been shown + if(result.length == 0){ + //Avoid useless traffic + ComunicWeb.pages.userPage.posts._load_post_locked = true; + } + //Call callback (if any) if(callback) callback(); @@ -139,7 +145,6 @@ ComunicWeb.pages.userPage.posts = { if(this._last_post_id == 0){ this._no_posts_msg(target); } - }, /**