mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Simplify initial pointer selection
This code had decayed from something more substantial into a kind of silly loop. (imported from commit a6668c19bd6d50325460ac4fa4146d7f82fec58b)
This commit is contained in:
parent
8bc01c85f1
commit
f03efcd788
@ -981,13 +981,11 @@ function add_messages(data) {
|
||||
// Even when narrowed, add messages to the home view so they exist when we un-narrow.
|
||||
add_to_table(data.zephyrs, 'zhome', function () { return true; }, data.where);
|
||||
|
||||
$.each(data.zephyrs, function () {
|
||||
// If we received the initially selected message, select it on the client side,
|
||||
// but not if the user has already selected another one during load.
|
||||
if ((this.id === initial_pointer) && (selected_zephyr_id === -1)) {
|
||||
select_and_show_by_id(initial_pointer);
|
||||
}
|
||||
});
|
||||
// If we received the initially selected message, select it on the client side,
|
||||
// but not if the user has already selected another one during load.
|
||||
if ((selected_zephyr_id === -1) && (initial_pointer in zephyr_dict)) {
|
||||
select_and_show_by_id(initial_pointer);
|
||||
}
|
||||
|
||||
// If we prepended messages, then we need to scroll back to the pointer.
|
||||
// This will mess with the user's scrollwheel use; possibly we should be
|
||||
|
||||
Loading…
Reference in New Issue
Block a user