message_edit: Rename variable for clarity.

This commit is contained in:
Aman Agrawal 2024-11-17 09:51:11 +05:30 committed by Tim Abbott
parent c16f3c5eca
commit dd58698c02
1 changed files with 7 additions and 7 deletions

View File

@ -1257,28 +1257,28 @@ export function edit_last_sent_message(): void {
return;
}
const msg = message_lists.current.get_last_message_sent_by_me();
const last_sent_msg = message_lists.current.get_last_message_sent_by_me();
if (!msg) {
if (!last_sent_msg) {
return;
}
if (!msg.id) {
if (!last_sent_msg.id) {
blueslip.error("Message has invalid id in edit_last_sent_message.");
return;
}
if (!is_content_editable(msg, 5)) {
if (!is_content_editable(last_sent_msg, 5)) {
return;
}
message_lists.current.select_id(msg.id, {then_scroll: true});
message_lists.current.select_id(last_sent_msg.id, {then_scroll: true});
const $msg_row = message_lists.current.get_row(msg.id);
const $msg_row = message_lists.current.get_row(last_sent_msg.id);
if (!$msg_row) {
// This should never happen, since we got the message above
// from message_lists.current.
blueslip.error("Could not find row for id", {msg_id: msg.id});
blueslip.error("Could not find row for id", {msg_id: last_sent_msg.id});
return;
}