From 648e6f419534c315ade5a506e8ec8820872ee7c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 14 Sep 2017 17:57:18 +0200 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20send=20request=20to=20node=20if?= =?utf8?q?=20there=20are=20no=20posts=20or=20replies=20to=20get=20the=20ti?= =?utf8?q?mes=20for?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/javascript/sone.js | 32 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index b3f5c83..84be0d4 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1646,13 +1646,15 @@ function updatePostTime(postId, timeText, refreshTime, tooltip) { * Comma-separated post IDs */ function updatePostTimes(postIds) { - ajaxGet("getTimes.ajax", { "posts" : postIds }, function(data, textStatus) { - if ((data != null) && data.success) { - $.each(data.postTimes, function(index, value) { - updatePostTime(index, value.timeText, value.refreshTime, value.tooltip); - }); - } - }); + if (postIds != "") { + ajaxGet("getTimes.ajax", {"posts": postIds}, function (data, textStatus) { + if ((data != null) && data.success) { + $.each(data.postTimes, function (index, value) { + updatePostTime(index, value.timeText, value.refreshTime, value.tooltip); + }); + } + }); + } } /** @@ -1683,13 +1685,15 @@ function updateReplyTime(replyId, timeText, refreshTime, tooltip) { * Comma-separated post IDs */ function updateReplyTimes(replyIds) { - ajaxGet("getTimes.ajax", { "replies" : replyIds }, function(data, textStatus) { - if ((data != null) && data.success) { - $.each(data.replyTimes, function(index, value) { - updateReplyTime(index, value.timeText, value.refreshTime, value.tooltip); - }); - } - }); + if (replyIds != "") { + ajaxGet("getTimes.ajax", {"replies": replyIds}, function (data, textStatus) { + if ((data != null) && data.success) { + $.each(data.replyTimes, function (index, value) { + updateReplyTime(index, value.timeText, value.refreshTime, value.tooltip); + }); + } + }); + } } function resetActivity() { -- 2.7.4