Skip to content

Commit 169ddb3

Browse files
authored
Merge pull request #1649 from mercihabam/fix-new-rows-order
fix(frontend): ensure that new messages are inserted in the right position in the list ordered chronologically
2 parents 6ed7485 + 4379753 commit 169ddb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/imap/site.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,9 @@ async function select_imap_folder(path, page = 1,reload, processInTheBackground
403403
const rowUid = row.data('uid');
404404
const tableRow = Hm_Utils.tbody().find(`tr[data-uid="${rowUid}"]`);
405405
if (!tableRow.length) {
406-
const index = messages.rows.indexOf(row);
406+
const index = messages.rows.map(r => $(r['0']).data('uid')).indexOf(rowUid);
407407
if (Hm_Utils.rows().length >= index) {
408-
Hm_Utils.rows().eq(index).after(row);
408+
Hm_Utils.rows().eq(index).before(row);
409409
} else {
410410
Hm_Utils.tbody().append(row);
411411
}

0 commit comments

Comments
 (0)