Eliminate have_scrolled_away_from_top boolean.

The `have_scrolled_away_from_top` logic goes way back
to November 2012.

Now we unconditionally load older messages when we scroll
to the top of the feed.  Before this bug, you could get
"stuck."  It was a bit difficult to reproduce, but with
the right combination of render window sizes and batch
sizes, you would hit the home key quickly and hit the top
of the feed in a way that the flag got in the way of
going back in history.

Fixes #6628
This commit is contained in:
Steve Howell 2017-09-30 09:27:04 -07:00 committed by Tim Abbott
parent 4d00c390ea
commit c5b7e3f1ab
1 changed files with 2 additions and 7 deletions

View File

@ -4,8 +4,6 @@ var exports = {};
var actively_scrolling = false;
exports.have_scrolled_away_from_top = true;
exports.actively_scrolling = function () {
return actively_scrolling;
};
@ -220,13 +218,10 @@ function scroll_finished() {
pointer.suppress_scroll_pointer_update = false;
}
floating_recipient_bar.update();
if (message_viewport.scrollTop() === 0 &&
ui.have_scrolled_away_from_top) {
ui.have_scrolled_away_from_top = false;
if (message_viewport.scrollTop() === 0) {
message_fetch.load_more_messages(current_msg_list);
} else if (!ui.have_scrolled_away_from_top) {
ui.have_scrolled_away_from_top = true;
}
// When the window scrolls, it may cause some messages to
// enter the screen and become read. Calling
// unread_ops.process_visible will update necessary