mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +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;
|
initial_narrow_offset = narrow_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initialize(home_view_loaded) {
|
export function initialize(finished_initial_fetch) {
|
||||||
// get the initial message list
|
// get the initial message list
|
||||||
function load_more(data) {
|
function load_more(data) {
|
||||||
// If we haven't selected a message in the home view yet, and
|
// 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.
|
// See server_events.js for this callback.
|
||||||
home_view_loaded();
|
finished_initial_fetch();
|
||||||
|
|
||||||
start_backfilling_messages();
|
start_backfilling_messages();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export let queue_id;
|
|||||||
let last_event_id;
|
let last_event_id;
|
||||||
let event_queue_longpoll_timeout_seconds;
|
let event_queue_longpoll_timeout_seconds;
|
||||||
|
|
||||||
let waiting_on_homeview_load = true;
|
let waiting_on_initial_fetch = true;
|
||||||
|
|
||||||
let events_stored_while_loading = [];
|
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];
|
events_stored_while_loading = [...events_stored_while_loading, ...events];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -285,8 +285,8 @@ export function force_get_events() {
|
|||||||
get_events_timeout = setTimeout(get_events, 0);
|
get_events_timeout = setTimeout(get_events, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function home_view_loaded() {
|
export function finished_initial_fetch() {
|
||||||
waiting_on_homeview_load = false;
|
waiting_on_initial_fetch = false;
|
||||||
get_events_success([]);
|
get_events_success([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -798,7 +798,7 @@ export function initialize_everything(state_data) {
|
|||||||
reload_setup.initialize();
|
reload_setup.initialize();
|
||||||
unread.initialize(unread_params);
|
unread.initialize(unread_params);
|
||||||
bot_data.initialize(bot_params); // Must happen after people.initialize()
|
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();
|
message_scroll.initialize();
|
||||||
markdown.initialize(markdown_config.get_helpers());
|
markdown.initialize(markdown_config.get_helpers());
|
||||||
linkifiers.initialize(realm.realm_linkifiers);
|
linkifiers.initialize(realm.realm_linkifiers);
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ function test_fetch_success(opts) {
|
|||||||
process_results.verify();
|
process_results.verify();
|
||||||
}
|
}
|
||||||
|
|
||||||
function initial_fetch_step(home_view_loaded) {
|
function initial_fetch_step(finished_initial_fetch) {
|
||||||
const self = {};
|
const self = {};
|
||||||
|
|
||||||
let fetch;
|
let fetch;
|
||||||
@@ -207,7 +207,7 @@ function initial_fetch_step(home_view_loaded) {
|
|||||||
expected_opts_data: initialize_data.initial_fetch.req,
|
expected_opts_data: initialize_data.initial_fetch.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
message_fetch.initialize(home_view_loaded);
|
message_fetch.initialize(finished_initial_fetch);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.finish = () => {
|
self.finish = () => {
|
||||||
@@ -281,11 +281,11 @@ run_test("initialize", () => {
|
|||||||
old_unreads_missing: false,
|
old_unreads_missing: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
function home_view_loaded() {
|
function finished_initial_fetch() {
|
||||||
home_loaded = true;
|
home_loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const step1 = initial_fetch_step(home_view_loaded);
|
const step1 = initial_fetch_step(finished_initial_fetch);
|
||||||
|
|
||||||
step1.prep();
|
step1.prep();
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ const message_events = mock_esm("../src/message_events", {
|
|||||||
|
|
||||||
const server_events = zrequire("server_events");
|
const server_events = zrequire("server_events");
|
||||||
|
|
||||||
server_events.home_view_loaded();
|
server_events.finished_initial_fetch();
|
||||||
|
|
||||||
run_test("message_event", ({override}) => {
|
run_test("message_event", ({override}) => {
|
||||||
const event = {
|
const event = {
|
||||||
@@ -79,7 +79,7 @@ run_test("message_event", ({override}) => {
|
|||||||
// Start blueslip tests here
|
// Start blueslip tests here
|
||||||
|
|
||||||
const setup = () => {
|
const setup = () => {
|
||||||
server_events.home_view_loaded();
|
server_events.finished_initial_fetch();
|
||||||
};
|
};
|
||||||
|
|
||||||
run_test("event_dispatch_error", () => {
|
run_test("event_dispatch_error", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user