diff --git a/public/js/client.js b/public/js/client.js index a843e21a..0174dca5 100644 --- a/public/js/client.js +++ b/public/js/client.js @@ -6079,10 +6079,7 @@ function setParticipantsBtn() { chatPin(); } - msgerDraggable.classList.add('msger-pinned-sidebar-open'); - msgerCPBtn.classList.add('active'); - searchPeerBarName?.focus(); - screenReaderAccessibility.announceMessage('Pinned chat participants opened'); + openPinnedParticipantsSidebar(true); return; } @@ -6092,6 +6089,20 @@ function setParticipantsBtn() { }); } +function openPinnedParticipantsSidebar(announce = false) { + if (!isChatPinned) { + return; + } + + msgerDraggable.classList.add('msger-pinned-sidebar-open'); + msgerCPBtn.classList.add('active'); + searchPeerBarName?.focus(); + + if (announce) { + screenReaderAccessibility.announceMessage('Pinned chat participants opened'); + } +} + /** * Caption room buttons click event */ @@ -9860,6 +9871,10 @@ function handleDataChannelChat(dataMessage) { if (msgPrivate) { if (!isConversationCurrentlyVisible('private', msgFrom, msgFromId)) { addUnreadMessage('private', msgFromId); + + if (isChatRoomVisible && isChatPinned) { + openPinnedParticipantsSidebar(); + } } } else if (!isConversationCurrentlyVisible('public')) { addUnreadMessage('public');