mirror of https://github.com/zulip/zulip.git
Make get_updates reload_pending request parameter an integer
This fixes a bug where the server wasn't returning from get_updates immediately when the client needed a reload. (imported from commit 1d854eb1c7061f468d091e103f10074f4c7231d8)
This commit is contained in:
parent
bbb67f61cc
commit
ab382040c1
|
@ -14,7 +14,7 @@ var get_updates_params = {
|
|||
last: -1,
|
||||
failures: 0,
|
||||
server_generation: -1, /* to be filled in on document.ready */
|
||||
reload_pending: false
|
||||
reload_pending: 0
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
@ -604,7 +604,7 @@ function get_updates() {
|
|||
if (get_updates_params.server_generation === -1) {
|
||||
get_updates_params.server_generation = data.server_generation;
|
||||
} else if (data.server_generation !== get_updates_params.server_generation) {
|
||||
get_updates_params.reload_pending = true;
|
||||
get_updates_params.reload_pending = 1;
|
||||
reload_app();
|
||||
}
|
||||
|
||||
|
|
|
@ -250,6 +250,8 @@ def return_messages_immediately(request, handler, user_profile, **kwargs):
|
|||
last = int(last)
|
||||
if failures is not None:
|
||||
failures = int(failures)
|
||||
if client_reload_pending is not None:
|
||||
client_reload_pending = int(client_reload_pending)
|
||||
|
||||
where = 'bottom'
|
||||
query = Message.objects.select_related().filter(usermessage__user_profile = user_profile).order_by('id')
|
||||
|
|
Loading…
Reference in New Issue