From 840792ae35c9531edbb3aa828786c8f1c8c9e99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 13 Jul 2023 19:35:23 -0400 Subject: [PATCH] fix: #11797, update title on chat switch --- public/src/ajaxify.js | 1 + public/src/client/chats.js | 1 + 2 files changed, 2 insertions(+) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 8111f0ef09..0971896727 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -229,6 +229,7 @@ ajaxify.widgets = { render: render }; }); }); } + ajaxify.updateTitle = updateTitle; function updateTags() { const metaWhitelist = ['title', 'description', /og:.+/, /article:.+/, 'robots'].map(function (val) { diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 41aaf3d93c..ad9147cb3c 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -464,6 +464,7 @@ define('forum/chats', [ chatNavWrapper = $('[component="chat/nav-wrapper"]'); html.find('.timeago').timeago(); ajaxify.data = { ...ajaxify.data, ...payload, roomId: roomId }; + ajaxify.updateTitle(ajaxify.data.title); $('body').toggleClass('chat-loaded', !!roomId); mainWrapper.find('[data-bs-toggle="tooltip"]').tooltip(); Chats.setActive(roomId);