Reset desktop chat unread badge when opened
This commit is contained in:
parent
2ea0952f16
commit
58319ec0f9
1 changed files with 2 additions and 0 deletions
|
|
@ -107,6 +107,7 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) {
|
|||
const unreadIds = payload.messages.filter(m => !m.isFromMachine).map(m => m.id as string)
|
||||
if (unreadIds.length > 0) {
|
||||
markMachineMessagesRead(ticketId, unreadIds).catch(err => console.error("mark read falhou", err))
|
||||
setUnreadCount(0)
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
|
|
@ -218,6 +219,7 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) {
|
|||
|
||||
const handleExpand = async () => {
|
||||
setIsMinimized(false)
|
||||
setUnreadCount(0)
|
||||
try {
|
||||
await invoke("set_chat_minimized", { ticketId, minimized: false })
|
||||
} catch (err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue