[24.2] Ensure job states are fetched in invocation view

Fixes https://github.com/galaxyproject/galaxy/issues/20003

We weren't checking if the job states summary had been fetched before we had the
```
if (invocationSchedulingTerminal.value && jobCount.value === 0)
```
check. `jobCount` would always be 0 if the states summary hadn't been fetched yet.
This commit is contained in:
Ahmed Awan
2025-04-14 15:32:45 -05:00
parent d44bac9efb
commit 00aa61cbc0
@@ -108,11 +108,16 @@ const invocationSchedulingTerminal = computed(() => {
);
});
const jobStatesTerminal = computed(() => {
// If the job states summary is null, we haven't fetched it yet
if (jobStatesSummary.value === null) {
return false;
}
if (invocationSchedulingTerminal.value && jobCount.value === 0) {
// no jobs for this invocation (think subworkflow or just inputs)
// no jobs for this invocation (think it has just subworkflows/inputs)
return true;
}
return !!jobStatesSummary.value && isTerminal(jobStatesSummary.value as InvocationJobsSummary);
return isTerminal(jobStatesSummary.value);
});
const jobStatesSummary = computed(() => {
const jobsSummary = invocationStore.getInvocationJobsSummaryById(props.invocationId);