소스 검색

fix: prevent FileList from showing loading state during context updates

- Remove isContextLoading from FileList loading condition
- Only show loading state when files query is loading AND no data exists yet
- This prevents the page from flickering to loading state when AppContext refreshes
- Files now remain visible during background data synchronization

The issue was that isContextLoading would trigger whenever AppContext refetched
data (via WebSocket events or manual refreshes), causing the entire FileList to
revert to a loading state even when data was already displayed.
Timothy Pomeroy 1 개월 전
부모
커밋
fb44da8afe
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      apps/web/src/app/files/FileList.tsx

+ 3 - 3
apps/web/src/app/files/FileList.tsx

@@ -19,7 +19,7 @@ import { useAppContext } from "../providers/AppContext";
 export default function FileList() {
   const queryClient = useQueryClient();
   const { addNotification } = useNotifications();
-  const { datasets, isLoading: isContextLoading } = useAppContext();
+  const { datasets } = useAppContext();
 
   // Get files from all datasets
   const {
@@ -445,8 +445,8 @@ export default function FileList() {
 
   const displayFiles = paginatedData;
 
-  // Show loading state if datasets are loading, allFiles is loading, or data is undefined
-  if (isContextLoading || isLoading || !allFiles) {
+  // Show loading state only if files query is loading and we don't have data yet
+  if (isLoading && !allFiles) {
     return <LoadingCard message="Loading files..." />;
   }
   if (error) {