Skip to content

Commit

Permalink
Merge pull request #2511 from DaoDaoNoCode/jira-rhoaieng-3239
Browse files Browse the repository at this point in the history
Fix the issue of showing pipeline version on the runs table when there is no pipeline
  • Loading branch information
openshift-merge-bot[bot] authored Mar 1, 2024
2 parents 1bb32f3 + 68530fe commit 2e7e9d5
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 2e7e9d5

Please sign in to comment.