mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
js: Simplify indexing arrays from the end with Array#at.
https://github.com/tc39/proposal-relative-indexing-method Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
0b03628324
commit
c6b372b471
@@ -440,7 +440,7 @@ export function initialize(home_view_loaded) {
|
||||
// If we fall through here, we need to keep fetching more data, and
|
||||
// we'll call back to the function we're in.
|
||||
const messages = data.messages;
|
||||
const latest_id = messages[messages.length - 1].id;
|
||||
const latest_id = messages.at(-1).id;
|
||||
|
||||
load_messages({
|
||||
anchor: latest_id,
|
||||
|
||||
Reference in New Issue
Block a user