mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
widgets: Fix bug where process_submessages() was run for empty rows.
We now check if the row exists in the current view, and only then do we process the submessages in it, instead of letting `Error: Failed to do_process_submessages` happen.
This commit is contained in:
@@ -90,8 +90,9 @@ export function get_message_events(message: Message): SubmessageEvents | undefin
|
|||||||
|
|
||||||
export function process_widget_rows_in_list(list: MessageList | undefined): void {
|
export function process_widget_rows_in_list(list: MessageList | undefined): void {
|
||||||
for (const message_id of widgetize.widget_event_handlers.keys()) {
|
for (const message_id of widgetize.widget_event_handlers.keys()) {
|
||||||
if (list?.get(message_id) !== undefined) {
|
const $row = list?.get_row(message_id);
|
||||||
process_submessages({message_id, $row: list.get_row(message_id)});
|
if ($row && $row.length !== 0) {
|
||||||
|
process_submessages({message_id, $row});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user