From bf105daadc6de1996d57e0e4e59b084eb7ff759d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 9 Feb 2020 00:55:01 +0100 Subject: [PATCH] bug: race coddition while processing url --- config.ini | 2 +- static/scripts/app.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/config.ini b/config.ini index 89724f9..52f527a 100644 --- a/config.ini +++ b/config.ini @@ -45,6 +45,6 @@ logs_path = data/logs/ [system] system_name = blog -version = 1.251 +version = 1.252 debug = false logs = false \ No newline at end of file diff --git a/static/scripts/app.js b/static/scripts/app.js index b862c88..e92c953 100644 --- a/static/scripts/app.js +++ b/static/scripts/app.js @@ -6,12 +6,13 @@ $("#dd_mask").click(function(){ // Posts loading functions var posts = { - first: false, // Is first loaded? - last: false, // Is last loaded? - loading: false, // Is something loading right now? + initialized: false, // Is initialized? + first: false, // Is first loaded? + last: false, // Is last loaded? + loading: false, // Is something loading right now? - limit: 5, // Limit posts per load - offset: 0, // Current offset + limit: 5, // Limit posts per load + offset: 0, // Current offset filter: { from: null, // Show posts from specified date @@ -57,7 +58,7 @@ var posts = { load: function(){ // If is something loading now or is loading done - if(posts.loading || posts.last) + if(!posts.initialized || posts.loading || posts.last) return ; // Now is @@ -111,6 +112,7 @@ var posts = { init: function(){ posts.hash_update(); + posts.initialized = true; } };