message_fetch: Revert home view bottom loading indicators.

In the very common event that one ends up looking at not the home view
while the browser is catching the home view up, this ended up
resulting in loading indicators being displayed at the bottom of
whatever narrowed view one was looking at incorrectly.

A proper fix for this will involve making these loading indicators
conditional on what view one is looking at.  Since one can change
views rapidly from a narrowed message list to the home view (and in
the future, between narrows), probably the best approach would be to
move the state in `message_scroll.js` the state for whether a loading
indicator is expected to be shown into the `fetch_status` data
structures, and then make all decisions about whether to show/hide a
loading indicator be calls to a function with a name like:

current_msg_list.data.fetch_status.update_newer_loading_indicator()

At least, that's probably what we should call in places like
`narrow.deactivate()`.
This commit is contained in:
Tim Abbott
2020-06-14 10:00:01 -07:00
parent a1259c2521
commit 67053ff479

View File

@@ -352,7 +352,6 @@ exports.initialize = function () {
}
if (data.found_newest) {
message_scroll.hide_loading_newer();
server_events.home_view_loaded();
exports.start_backfilling_messages();
return;
@@ -363,7 +362,6 @@ exports.initialize = function () {
const messages = data.messages;
const latest_id = messages[messages.length - 1].id;
message_scroll.show_loading_newer();
exports.load_messages({
anchor: latest_id.toFixed(),
num_before: 0,