ソースを参照

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) {