add some refetching and invalidating logic for workflow runs (#1048)

This commit is contained in:
Shuchang Zheng
2024-10-24 07:12:53 -07:00
committed by GitHub
parent 9c7380a6e1
commit 1b635d6a79
2 changed files with 24 additions and 0 deletions

View File

@@ -97,6 +97,18 @@ function WorkflowRun() {
return false;
},
placeholderData: keepPreviousData,
refetchOnMount: (query) => {
if (!query.state.data) {
return false;
}
return statusIsRunningOrQueued(query.state.data);
},
refetchOnWindowFocus: (query) => {
if (!query.state.data) {
return false;
}
return statusIsRunningOrQueued(query.state.data);
},
});
const { data: workflowTasks, isLoading: workflowTasksIsLoading } = useQuery<