mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
Corrige a busca no whaticket
Estavam aparecendo mensagens novas na busca e a busca estava trazendo resultados da busca anterior
This commit is contained in:
@@ -179,12 +179,12 @@ const reducer = (state, action) => {
|
||||
type: "LOAD_TICKETS",
|
||||
payload: tickets,
|
||||
});
|
||||
}, [tickets, status, searchParam]);
|
||||
}, [tickets]);
|
||||
|
||||
useEffect(() => {
|
||||
const socket = openSocket();
|
||||
|
||||
const shouldUpdateTicket = ticket =>
|
||||
const shouldUpdateTicket = ticket => !searchParam &&
|
||||
(!ticket.userId || ticket.userId === user?.id || showAll) &&
|
||||
(!ticket.queueId || selectedQueueIds.indexOf(ticket.queueId) > -1);
|
||||
|
||||
@@ -244,7 +244,7 @@ const reducer = (state, action) => {
|
||||
return () => {
|
||||
socket.disconnect();
|
||||
};
|
||||
}, [status, showAll, user, selectedQueueIds]);
|
||||
}, [status, searchParam, showAll, user, selectedQueueIds]);
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof updateCount === "function") {
|
||||
|
||||
@@ -118,6 +118,7 @@ const TicketsManager = () => {
|
||||
useEffect(() => {
|
||||
if (tab === "search") {
|
||||
searchInputRef.current.focus();
|
||||
setSearchParam("");
|
||||
}
|
||||
}, [tab]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user