mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-08 22:22:17 +02:00
Merge pull request #1579 from AnishSarkar22/hotfix/ci-ui
fix: reduce thread fetch limit
This commit is contained in:
commit
261ace58f9
5 changed files with 7 additions and 9 deletions
|
|
@ -118,10 +118,10 @@ export function LayoutDataProvider({ workspaceId, children }: LayoutDataProvider
|
|||
enabled: !!workspaceId,
|
||||
});
|
||||
|
||||
// Fetch threads (40 total to allow up to 20 per section - shared/private)
|
||||
// Fetch recent threads for the sidebar.
|
||||
const { data: threadsData, isPending: isLoadingThreads } = useQuery({
|
||||
queryKey: ["threads", workspaceId, { limit: 40 }],
|
||||
queryFn: () => fetchThreads(Number(workspaceId), 40),
|
||||
queryKey: ["threads", workspaceId, { limit: 6 }],
|
||||
queryFn: () => fetchThreads(Number(workspaceId), 6),
|
||||
enabled: !!workspaceId,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ function AllChatsContent({ workspaceId, className }: AllChatsContentProps) {
|
|||
queryKey: ["all-threads", workspaceId],
|
||||
queryFn: () => fetchThreads(Number(workspaceId)),
|
||||
enabled: !!workspaceId && !isSearchMode,
|
||||
placeholderData: () => queryClient.getQueryData(["threads", workspaceId, { limit: 40 }]),
|
||||
placeholderData: () => queryClient.getQueryData(["threads", workspaceId, { limit: 6 }]),
|
||||
});
|
||||
|
||||
const {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import { sidebarListItemClassName } from "./SidebarListItem";
|
|||
interface ChatListItemProps {
|
||||
name: string;
|
||||
isActive?: boolean;
|
||||
isShared?: boolean;
|
||||
archived?: boolean;
|
||||
dropdownOpen?: boolean;
|
||||
onDropdownOpenChange?: (open: boolean) => void;
|
||||
|
|
|
|||
|
|
@ -311,12 +311,11 @@ export function Sidebar({
|
|||
) : chats.length > 0 ? (
|
||||
<div className="relative">
|
||||
<div className={`flex flex-col gap-0.5 ${chats.length > 4 ? "pb-2" : ""}`}>
|
||||
{chats.slice(0, 20).map((chat) => (
|
||||
{chats.slice(0, 6).map((chat) => (
|
||||
<ChatListItem
|
||||
key={chat.id}
|
||||
name={chat.name}
|
||||
isActive={chat.id === activeChatId}
|
||||
isShared={chat.visibility === "SEARCH_SPACE"}
|
||||
archived={chat.archived}
|
||||
dropdownOpen={openDropdownChatId === chat.id}
|
||||
onDropdownOpenChange={(open) =>
|
||||
|
|
|
|||
|
|
@ -395,8 +395,8 @@ export function OnboardingTour() {
|
|||
|
||||
// Fetch threads data
|
||||
const { data: threadsData } = useQuery({
|
||||
queryKey: ["threads", workspaceId, { limit: 40 }], // Same key as layout
|
||||
queryFn: () => fetchThreads(Number(workspaceId), 40),
|
||||
queryKey: ["threads", workspaceId, { limit: 6 }], // Same key as layout
|
||||
queryFn: () => fetchThreads(Number(workspaceId), 6),
|
||||
enabled: !!workspaceId,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue