single_message: Use data-message-id instead of zid.

This commit is contained in:
Aman Agrawal
2024-01-10 08:31:36 +00:00
committed by Tim Abbott
parent 633f64a79e
commit df180f7bd5
9 changed files with 37 additions and 29 deletions

View File

@@ -1500,7 +1500,7 @@ export class MessageListView {
const $row = this._rows.get(old_id);
this._rows.delete(old_id);
$row.attr("zid", new_id);
$row.attr("data-message-id", new_id);
$row.attr("id", `message-row-${this.list.id}-` + new_id);
$row.removeClass("local");
this._rows.set(new_id, $row);
@@ -1688,7 +1688,8 @@ export class MessageListView {
show_messages_as_unread(message_ids) {
const $rows_to_show_as_unread = this.$list.find(".message_row").filter((_index, $row) => {
const message_id = Number.parseFloat($row.getAttribute("zid"));
// eslint-disable-next-line unicorn/prefer-dom-node-dataset
const message_id = Number.parseFloat($row.getAttribute("data-message-id"));
return message_ids.includes(message_id);
});
$rows_to_show_as_unread.addClass("unread");