Move zephyr rendering inside longpoll success callback

(imported from commit f7c2bbb0a31b339892a033e4192e44cb53b0d62c)
This commit is contained in:
Keegan McAllister
2012-09-05 14:06:08 -04:00
parent 162cb075b7
commit 1f522eddac

View File

@@ -389,10 +389,7 @@ $(function () {
var longpoll_failures = 0;
function get_updates_longpoll(data) {
if (data && data.zephyrs) {
$.each(data.zephyrs, add_message);
}
function get_updates_longpoll() {
var last_received = 0;
if ($("tr:last").attr("id")) {
last_received = $("tr:last").attr("id");
@@ -406,7 +403,10 @@ function get_updates_longpoll(data) {
success: function (data) {
console.log(new Date() + ': longpoll success');
longpoll_failures = 0;
get_updates_longpoll(data);
if (data && data.zephyrs) {
$.each(data.zephyrs, add_message);
}
get_updates_longpoll();
},
error: function () {
longpoll_failures += 1;