Skip to content

Commit 64c21a4

Browse files
authored
Merge branch 'master' into close-emoji-picker
2 parents 508796e + 6f9123b commit 64c21a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/ChannelList/hooks/usePaginatedChannels.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { useEffect, useState } from 'react';
3+
import { useEffect, useMemo, useState } from 'react';
44
import { MAX_QUERY_CHANNELS_LIMIT } from '../utils';
55
/**
66
* @typedef {import('stream-chat').Channel} Channel
@@ -24,6 +24,8 @@ export const usePaginatedChannels = (
2424
const [error, setError] = useState(false);
2525
const [hasNextPage, setHasNextPage] = useState(true);
2626

27+
const filterString = useMemo(() => JSON.stringify(filters), [filters]);
28+
2729
/**
2830
* @param {string} [queryType]
2931
*/
@@ -78,7 +80,7 @@ export const usePaginatedChannels = (
7880
useEffect(() => {
7981
queryChannels('reload');
8082
// eslint-disable-next-line react-hooks/exhaustive-deps
81-
}, [filters]);
83+
}, [filterString]);
8284

8385
return {
8486
channels,

0 commit comments

Comments
 (0)