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)
|
const unreadIds = payload.messages.filter(m => !m.isFromMachine).map(m => m.id as string)
|
||||||
if (unreadIds.length > 0) {
|
if (unreadIds.length > 0) {
|
||||||
markMachineMessagesRead(ticketId, unreadIds).catch(err => console.error("mark read falhou", err))
|
markMachineMessagesRead(ticketId, unreadIds).catch(err => console.error("mark read falhou", err))
|
||||||
|
setUnreadCount(0)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
|
|
@ -218,6 +219,7 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) {
|
||||||
|
|
||||||
const handleExpand = async () => {
|
const handleExpand = async () => {
|
||||||
setIsMinimized(false)
|
setIsMinimized(false)
|
||||||
|
setUnreadCount(0)
|
||||||
try {
|
try {
|
||||||
await invoke("set_chat_minimized", { ticketId, minimized: false })
|
await invoke("set_chat_minimized", { ticketId, minimized: false })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue