mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
Move zephyr rendering inside longpoll success callback
(imported from commit f7c2bbb0a31b339892a033e4192e44cb53b0d62c)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user