mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
server_events: Rename home_view_loaded related variables.
Gave them a more general name which reflected what they were really doing.
This commit is contained in:
@@ -548,7 +548,7 @@ export function set_initial_pointer_and_offset({pointer, offset, narrow_pointer,
|
||||
initial_narrow_offset = narrow_offset;
|
||||
}
|
||||
|
||||
export function initialize(home_view_loaded) {
|
||||
export function initialize(finished_initial_fetch) {
|
||||
// get the initial message list
|
||||
function load_more(data) {
|
||||
// If we haven't selected a message in the home view yet, and
|
||||
@@ -579,7 +579,7 @@ export function initialize(home_view_loaded) {
|
||||
}
|
||||
|
||||
// See server_events.js for this callback.
|
||||
home_view_loaded();
|
||||
finished_initial_fetch();
|
||||
|
||||
start_backfilling_messages();
|
||||
return;
|
||||
|
||||
@@ -20,7 +20,7 @@ export let queue_id;
|
||||
let last_event_id;
|
||||
let event_queue_longpoll_timeout_seconds;
|
||||
|
||||
let waiting_on_homeview_load = true;
|
||||
let waiting_on_initial_fetch = true;
|
||||
|
||||
let events_stored_while_loading = [];
|
||||
|
||||
@@ -49,7 +49,7 @@ function get_events_success(events) {
|
||||
}
|
||||
}
|
||||
|
||||
if (waiting_on_homeview_load) {
|
||||
if (waiting_on_initial_fetch) {
|
||||
events_stored_while_loading = [...events_stored_while_loading, ...events];
|
||||
return;
|
||||
}
|
||||
@@ -285,8 +285,8 @@ export function force_get_events() {
|
||||
get_events_timeout = setTimeout(get_events, 0);
|
||||
}
|
||||
|
||||
export function home_view_loaded() {
|
||||
waiting_on_homeview_load = false;
|
||||
export function finished_initial_fetch() {
|
||||
waiting_on_initial_fetch = false;
|
||||
get_events_success([]);
|
||||
}
|
||||
|
||||
|
||||
@@ -798,7 +798,7 @@ export function initialize_everything(state_data) {
|
||||
reload_setup.initialize();
|
||||
unread.initialize(unread_params);
|
||||
bot_data.initialize(bot_params); // Must happen after people.initialize()
|
||||
message_fetch.initialize(server_events.home_view_loaded);
|
||||
message_fetch.initialize(server_events.finished_initial_fetch);
|
||||
message_scroll.initialize();
|
||||
markdown.initialize(markdown_config.get_helpers());
|
||||
linkifiers.initialize(realm.realm_linkifiers);
|
||||
|
||||
@@ -196,7 +196,7 @@ function test_fetch_success(opts) {
|
||||
process_results.verify();
|
||||
}
|
||||
|
||||
function initial_fetch_step(home_view_loaded) {
|
||||
function initial_fetch_step(finished_initial_fetch) {
|
||||
const self = {};
|
||||
|
||||
let fetch;
|
||||
@@ -207,7 +207,7 @@ function initial_fetch_step(home_view_loaded) {
|
||||
expected_opts_data: initialize_data.initial_fetch.req,
|
||||
});
|
||||
|
||||
message_fetch.initialize(home_view_loaded);
|
||||
message_fetch.initialize(finished_initial_fetch);
|
||||
};
|
||||
|
||||
self.finish = () => {
|
||||
@@ -281,11 +281,11 @@ run_test("initialize", () => {
|
||||
old_unreads_missing: false,
|
||||
};
|
||||
|
||||
function home_view_loaded() {
|
||||
function finished_initial_fetch() {
|
||||
home_loaded = true;
|
||||
}
|
||||
|
||||
const step1 = initial_fetch_step(home_view_loaded);
|
||||
const step1 = initial_fetch_step(finished_initial_fetch);
|
||||
|
||||
step1.prep();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ const message_events = mock_esm("../src/message_events", {
|
||||
|
||||
const server_events = zrequire("server_events");
|
||||
|
||||
server_events.home_view_loaded();
|
||||
server_events.finished_initial_fetch();
|
||||
|
||||
run_test("message_event", ({override}) => {
|
||||
const event = {
|
||||
@@ -79,7 +79,7 @@ run_test("message_event", ({override}) => {
|
||||
// Start blueslip tests here
|
||||
|
||||
const setup = () => {
|
||||
server_events.home_view_loaded();
|
||||
server_events.finished_initial_fetch();
|
||||
};
|
||||
|
||||
run_test("event_dispatch_error", () => {
|
||||
|
||||
Reference in New Issue
Block a user