message_list_data: Fix _next_nonlocal_message type.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-05-23 18:50:39 -07:00 committed by Anders Kaseorg
parent 24904f32bb
commit a1895683b2
1 changed files with 5 additions and 3 deletions

View File

@ -535,12 +535,14 @@ export class MessageListData {
item_list: Message[],
start_index: number,
op: (idx: number) => number,
): Message {
): Message | undefined {
let cur_idx = start_index;
let message;
do {
cur_idx = op(cur_idx);
} while (item_list[cur_idx] !== undefined && this._is_localonly_id(item_list[cur_idx].id));
return item_list[cur_idx];
message = item_list[cur_idx];
} while (message !== undefined && this._is_localonly_id(message.id));
return message;
}
change_message_id(old_id: number, new_id: number): boolean {