mirror of https://github.com/zulip/zulip.git
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:
parent
4d00c390ea
commit
c5b7e3f1ab
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue