Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/coronasafe/ayushma_fe
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Feb 1, 2024
2 parents 87fd854 + d03ade8 commit fa6203e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/app/(main)/project/[project_id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default function Chat(params: { params: { project_id: string } }) {
});
if (message.stop) setIsTyping(false);
if (message.error) {
setChatMessage("");
setIsTyping(false);
}
};
Expand Down
5 changes: 3 additions & 2 deletions src/components/sidebar/chatSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ export default function ChatSideBar(props: { project_id?: string }) {
const debouncedSearchQuery = useDebounce(searchQuery, 1000);
const chatsQuery = useInfiQuery({
queryKey: ["search", debouncedSearchQuery],
queryFn: ({ pageParam = 0 }) => {
return API.chat.list(
queryFn: async ({ pageParam = 0 }) => {
const res = await API.chat.list(
project_id || "",
{
offset: pageParam,
search: debouncedSearchQuery
},
);
return { ...res, offset: pageParam };
},
enabled: !!project_id,
},
Expand Down
2 changes: 1 addition & 1 deletion src/utils/hooks/useInfiQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useInfiQuery: (options: InfiQueryProps) => InfiQueryResult<any> = (
queryKey,
queryFn,
initialPageParam: 0,
getNextPageParam: (lastPage: any) => lastPage.has_next ? lastPage.offset + (fetchLimit || 10) : undefined,
getNextPageParam: (lastPage: any) => lastPage.has_next ? (lastPage.offset ?? 0) + (fetchLimit ?? 10) : undefined,
});

const loadMore = () => {
Expand Down

0 comments on commit fa6203e

Please sign in to comment.