fix: fix conversations in nav (put refreshConvoHint back)

This commit is contained in:
Daniel D Orlando 2023-04-03 14:57:30 -07:00
parent dd0a91a9f6
commit 573112de7b
5 changed files with 8 additions and 16 deletions

View file

@ -37,7 +37,7 @@ export default function Nav({ navVisible, setNavVisible }) {
const conversation = useRecoilValue(store.conversation);
const { conversationId } = conversation || {};
const setSearchResultMessages = useSetRecoilState(store.searchResultMessages);
const refreshConversationsHint = useRecoilValue(store.refreshConversationsHint);
const { refreshConversations } = store.useConversations();
const [isFetching, setIsFetching] = useState(false);
@ -112,6 +112,12 @@ export default function Nav({ navVisible, setNavVisible }) {
}
}, [getConversationsQuery.isSuccess, getConversationsQuery.data, isSearching, pageNumber]);
useEffect(() => {
if (!isSearching) {
getConversationsQuery.refetch();
}
}, [pageNumber, conversationId, refreshConversationsHint]);
const moveToTop = () => {
const container = containerRef.current;
if (container) {