From 972232b3707c5d7f5e4837a7b9e77ab2fcdcc07c Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 26 May 2018 16:21:18 +0200 Subject: [PATCH] Optimized code --- assets/js/pages/userPage/posts.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/assets/js/pages/userPage/posts.js b/assets/js/pages/userPage/posts.js index 71c09dee..7094029d 100644 --- a/assets/js/pages/userPage/posts.js +++ b/assets/js/pages/userPage/posts.js @@ -104,14 +104,9 @@ 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; - } + //Unlock posts loading, if required + if(result.length != 0) + ComunicWeb.pages.userPage.posts._load_post_locked = false; //Call callback (if any) if(callback)