diff --git a/frontend/src/hooks/useJsonPatchWsStream.ts b/frontend/src/hooks/useJsonPatchWsStream.ts index 6f55c137..8a017935 100644 --- a/frontend/src/hooks/useJsonPatchWsStream.ts +++ b/frontend/src/hooks/useJsonPatchWsStream.ts @@ -193,8 +193,9 @@ export const useJsonPatchWsStream = ( retryTimerRef.current = null; } finishedRef.current = false; - // Preserve data during reconnection attempts - only clear on unmount/disable - // Data will be refreshed when the new connection receives its initial snapshot + dataRef.current = undefined; + setData(undefined); + setIsInitialized(false); }; }, [ endpoint, @@ -205,14 +206,5 @@ export const useJsonPatchWsStream = ( retryNonce, ]); - // Clear data when the stream is disabled (separate effect to avoid clearing on reconnect) - useEffect(() => { - if (!enabled) { - dataRef.current = undefined; - setData(undefined); - setIsInitialized(false); - } - }, [enabled]); - return { data, isConnected, isInitialized, error }; }; diff --git a/frontend/src/pages/ProjectTasks.tsx b/frontend/src/pages/ProjectTasks.tsx index 98f73e6f..f16c70e5 100644 --- a/frontend/src/pages/ProjectTasks.tsx +++ b/frontend/src/pages/ProjectTasks.tsx @@ -152,7 +152,6 @@ export function ProjectTasks() { const { projectId, - project, isLoading: projectLoading, error: projectError, } = useProject(); @@ -846,8 +845,7 @@ export function ProjectTasks() { const isInitialTasksLoad = isLoading && tasks.length === 0; - // Only show full-page error if we have no project data at all - if (projectError && !project) { + if (projectError) { return (
@@ -1087,18 +1085,15 @@ export function ProjectTasks() { ); - const connectionError = - streamError || (projectError && project ? projectError.message : null); - return (
- {connectionError && ( + {streamError && ( {t('common:states.reconnecting')} - {connectionError} + {streamError} )}