Skip to content

Commit

Permalink
Fix the issue of showing pipeline version on the runs table when ther…
Browse files Browse the repository at this point in the history
…e is no pipeline
  • Loading branch information
DaoDaoNoCode committed Mar 1, 2024
1 parent 689eab8 commit 68530fe
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export const useAllPipelineVersions = (
refreshRate = 0,
): FetchState<PipelineListPaged<PipelineVersionKF>> => {
const { api } = usePipelinesAPI();
const [{ items: pipelines }] = usePipelines();
const [{ items: pipelines }, pipelinesLoaded] = usePipelines();
const pipelineIds = useDeepCompareMemoize(pipelines.map((pipeline) => pipeline.id));

return usePipelineQuery<PipelineVersionKF>(
React.useCallback(
async (opts, params) => {
if (pipelineIds.length === 0) {
return Promise.reject(new NotReadyError('No pipeline id'));
if (!pipelinesLoaded) {
return Promise.reject(new NotReadyError('Pipelines not loaded'));
}

const pipelineVersionRequests = pipelineIds.map((pipelineId) =>
Expand All @@ -42,7 +42,7 @@ export const useAllPipelineVersions = (
{ total_size: 0, items: [] },
);
},
[api, pipelineIds],
[api, pipelineIds, pipelinesLoaded],
),
options,
refreshRate,
Expand Down

0 comments on commit 68530fe

Please sign in to comment.