fix chat
This commit is contained in:
parent
7c12c70f90
commit
2441bc2b09
@ -158,8 +158,12 @@ export default function Chat({ open = false, onclickArrow, sx }: Props) {
|
||||
url:
|
||||
process.env.REACT_APP_DOMAIN +
|
||||
`/heruvym/v1.0.0/ticket?ticket=${sessionData?.ticketId}&s=${sessionData?.sessionId}`,
|
||||
|
||||
onNewData: (ticketMessages) => {
|
||||
console.log("ticketMessages useSSESubscription " + ticketMessages)
|
||||
console.log("Chat")
|
||||
|
||||
console.log("ticketMessages useSSESubscription ")
|
||||
console.log(ticketMessages)
|
||||
const isTicketClosed = ticketMessages.some(
|
||||
(message) => message.session_id === "close"
|
||||
);
|
||||
@ -171,10 +175,14 @@ export default function Chat({ open = false, onclickArrow, sx }: Props) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("under checking some close message -----------------------------------------")
|
||||
|
||||
updateSSEValue(ticketMessages);
|
||||
addOrUpdateUnauthMessages(ticketMessages);
|
||||
},
|
||||
onDisconnect: useCallback(() => {
|
||||
console.log("DISCONNECT")
|
||||
setUnauthIsPreventAutoscroll(false);
|
||||
setSseEnabled(false);
|
||||
}, []),
|
||||
|
@ -40,6 +40,7 @@ export default function ProtectedLayout() {
|
||||
process.env.REACT_APP_DOMAIN +
|
||||
`/heruvym/v1.0.0/subscribe?Authorization=${token}`,
|
||||
onNewData: (data) => {
|
||||
console.log("ProtectedLayout")
|
||||
updateSSEValue(data);
|
||||
updateTickets(data.filter((d) => Boolean(d.id)));
|
||||
setTicketCount(data.length);
|
||||
|
@ -99,7 +99,9 @@ function SupportChat() {
|
||||
url:
|
||||
process.env.REACT_APP_DOMAIN +
|
||||
`/heruvym/v1.0.0/ticket?ticket=${ticketId}&Authorization=${token}`,
|
||||
|
||||
onNewData: (ticketMessages) => {
|
||||
console.log("SupportChat")
|
||||
console.log("ticketMessages")
|
||||
console.log(ticketMessages)
|
||||
const data = ticketMessages.filter(t => {
|
||||
|
Loading…
Reference in New Issue
Block a user