Skip to content

Commit 6e5cb6d

Browse files
authored
Merge pull request #1617 from mercihabam/fix-browser-title
fix(frontend): inaccurate unread count in browser title and missing subject as title when reading a message
2 parents 717c28f + 284a2c3 commit 6e5cb6d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/imap/site.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ async function select_imap_folder(path, page = 1,reload, processInTheBackground
424424

425425
showPagination(messages.pages);
426426

427+
Hm_Message_List.update_title(path);
428+
427429
messages.newMessages.forEach((newMessage) => {
428430
const row = $(newMessage);
429431
triggerNewMessageEvent(row.data('uid'), row[0]);
@@ -473,9 +475,6 @@ var setup_imap_folder_page = async function(listPath, listPage = 1) {
473475
await select_imap_folder(listPath, listPage, true)
474476
}
475477

476-
// Update browser title
477-
Hm_Message_List.update_title(listPath);
478-
479478
// Refresh in the background each 30 seconds and abort any pending request when the page unmounts
480479
const backgroundAbortController = new AbortController();
481480
const interval = setInterval(async () => {
@@ -647,7 +646,7 @@ var get_message_content = function(msg_part, uid, list_path, listParent, detail,
647646
$('.msg_text').append(res.msg_text);
648647
$('.msg_text').append(res.msg_parts);
649648

650-
document.title = $('.header_subject th').text();
649+
document.title = $('.msg_text .small_header').first().text();
651650
imap_message_view_finished(uid, detail, listParent);
652651

653652
if (!res.show_pagination_links) {

0 commit comments

Comments
 (0)