mirror of https://github.com/zulip/zulip.git
reload: Handle early attempts at reload when loading the app.
Trying to preserve state when app modules like message_lists haven't been init results in errors.
This commit is contained in:
parent
5327bcc5ac
commit
8299506e7a
|
@ -40,6 +40,13 @@ function preserve_state(send_after_reload, save_pointer, save_narrow, save_compo
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!message_lists.home) {
|
||||||
|
// If we haven't yet initialized the message_lists module,
|
||||||
|
// we can't preserve state across reloads.
|
||||||
|
blueslip.log("Can't preserve state; message_lists not yet initialized.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let url = "#reload:send_after_reload=" + Number(send_after_reload);
|
let url = "#reload:send_after_reload=" + Number(send_after_reload);
|
||||||
url += "+csrf_token=" + encodeURIComponent(csrf_token);
|
url += "+csrf_token=" + encodeURIComponent(csrf_token);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue