diff --git a/view/packages/hooks/applications/use_deployment_logs_viewer.ts b/view/packages/hooks/applications/use_deployment_logs_viewer.ts index f8afbe707..289c43580 100644 --- a/view/packages/hooks/applications/use_deployment_logs_viewer.ts +++ b/view/packages/hooks/applications/use_deployment_logs_viewer.ts @@ -124,12 +124,13 @@ export function useDeploymentLogsViewer({ }, []); const refreshLogs = useCallback(async () => { - setAllLogs([]); setCurrentPage(1); - if (isDeployment) { - await refetchDeploymentLogs(); - } else { - await refetchApplicationLogs(); + setAllLogs([]); + const result = isDeployment ? await refetchDeploymentLogs() : await refetchApplicationLogs(); + + // Ensure logs are synced from the response + if (result.data?.logs) { + syncLogsFromResponse(result.data.logs, 1, setAllLogs); } }, [isDeployment, refetchDeploymentLogs, refetchApplicationLogs]);