Skip to content

Commit

Permalink
[FIX] Livechat CurrentChats infinity re-rendering (#27076)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoevanp authored Oct 18, 2022
1 parent 86ffdca commit f6bea29
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ const CurrentChatsRoute = (): ReactElement => {
const t = useTranslation();
const id = useRouteParameter('id');

const query = currentChatQuery(params, customFields, [sortBy, sortDirection]);
const query = useMemo(
() => currentChatQuery(params, customFields, [sortBy, sortDirection]),
[customFields, params, sortBy, sortDirection],
);
const canViewCurrentChats = usePermission('view-livechat-current-chats');
const canRemoveClosedChats = usePermission('remove-closed-livechat-room');
const directoryRoute = useRoute('omnichannel-current-chats');
Expand Down

0 comments on commit f6bea29

Please sign in to comment.