feat: added logic to unseen.js to handle unseen messages in video-call chats [WTEL-8866](https://webitel.atlassian.net/browse/WTEL-8866) - #1598
Open
plnnsimon wants to merge 3 commits into
Conversation
dlohvinov
reviewed
Sep 14, 2026
Comment on lines
+196
to
+225
| /** | ||
| * @author OleksandrPalonnyi | ||
| * | ||
| * the video-call chat's messages arrive by mutating the SDK Conversation | ||
| * instance directly — there's no WS event to hook, so new messages are | ||
| * detected the same way useChatScroll does: by watching message count | ||
| * | ||
| * [WTEL-8866](https://webitel.atlassian.net/browse/WTEL-8866) | ||
| * */ | ||
| watch(videoCallChatMessages, (messages, prevMessages) => { | ||
| const isNewMessage = messages?.length - (prevMessages?.length ?? 0) === 1; | ||
| if (!isNewMessage || isOnChat.value) return; | ||
|
|
||
| const lastMessage = messages.at(-1); | ||
| if (lastMessage?.member?.self) return; | ||
|
|
||
| store.commit('features/chat/unseen/ADD_UNSEEN_CHAT', videoCallChat.value); | ||
| }); | ||
|
|
||
| watch(isOnChat, (isActive) => { | ||
| if (isActive) { | ||
| store.dispatch('features/chat/unseen/MARK_CHAT_SEEN', videoCallChat.value); | ||
| } | ||
| }); | ||
|
|
||
| watch(videoCallChat, (chat, prevChat) => { | ||
| if (!chat && prevChat) { | ||
| store.commit('features/chat/unseen/REMOVE_UNSEEN_CHAT', prevChat); | ||
| } | ||
| }); |
Contributor
There was a problem hiding this comment.
а не хо це винести в окремий компоузабл (або декілька) щоб інкапсулювати від колл-хедера функціонал відеодзвінка і непрочитаних?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…