mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-17 19:37:02 +00:00
@@ -179,12 +179,12 @@ const reducer = (state, action) => {
|
|||||||
type: "LOAD_TICKETS",
|
type: "LOAD_TICKETS",
|
||||||
payload: tickets,
|
payload: tickets,
|
||||||
});
|
});
|
||||||
}, [tickets, status, searchParam]);
|
}, [tickets]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const socket = openSocket();
|
const socket = openSocket();
|
||||||
|
|
||||||
const shouldUpdateTicket = ticket =>
|
const shouldUpdateTicket = ticket => !searchParam &&
|
||||||
(!ticket.userId || ticket.userId === user?.id || showAll) &&
|
(!ticket.userId || ticket.userId === user?.id || showAll) &&
|
||||||
(!ticket.queueId || selectedQueueIds.indexOf(ticket.queueId) > -1);
|
(!ticket.queueId || selectedQueueIds.indexOf(ticket.queueId) > -1);
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ const reducer = (state, action) => {
|
|||||||
return () => {
|
return () => {
|
||||||
socket.disconnect();
|
socket.disconnect();
|
||||||
};
|
};
|
||||||
}, [status, showAll, user, selectedQueueIds]);
|
}, [status, searchParam, showAll, user, selectedQueueIds]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (typeof updateCount === "function") {
|
if (typeof updateCount === "function") {
|
||||||
@@ -263,6 +263,7 @@ const reducer = (state, action) => {
|
|||||||
const { scrollTop, scrollHeight, clientHeight } = e.currentTarget;
|
const { scrollTop, scrollHeight, clientHeight } = e.currentTarget;
|
||||||
|
|
||||||
if (scrollHeight - (scrollTop + 100) < clientHeight) {
|
if (scrollHeight - (scrollTop + 100) < clientHeight) {
|
||||||
|
e.currentTarget.scrollTop = scrollTop - 100;
|
||||||
loadMore();
|
loadMore();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ const TicketsManager = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tab === "search") {
|
if (tab === "search") {
|
||||||
searchInputRef.current.focus();
|
searchInputRef.current.focus();
|
||||||
|
setSearchParam("");
|
||||||
}
|
}
|
||||||
}, [tab]);
|
}, [tab]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user