mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
message edit: Select message id before getting row.
Getting the row was sometimes causing errors because the row wasn't in the DOM at the time of trying to get it. By selecting the message id first, we ensure it's in the DOM before we call `get_row`. More conversation here: https://chat.zulip.org/#narrow/stream/464-kandra-js-errors/topic/Error.3A.20Caller.20should.20pass.20in.20a.20single.20row.2E
This commit is contained in:
committed by
Anders Kaseorg
parent
2a57aa6cea
commit
17bc9af106
@@ -1132,6 +1132,8 @@ export function edit_last_sent_message() {
|
||||
return;
|
||||
}
|
||||
|
||||
message_lists.current.select_id(msg.id, {then_scroll: true, from_scroll: true});
|
||||
|
||||
const $msg_row = message_lists.current.get_row(msg.id);
|
||||
if (!$msg_row) {
|
||||
// This should never happen, since we got the message above
|
||||
@@ -1140,8 +1142,6 @@ export function edit_last_sent_message() {
|
||||
return;
|
||||
}
|
||||
|
||||
message_lists.current.select_id(msg.id, {then_scroll: true, from_scroll: true});
|
||||
|
||||
// Finally do the real work!
|
||||
compose_actions.cancel();
|
||||
start($msg_row, () => {
|
||||
|
||||
Reference in New Issue
Block a user