Skip to content

Commit 495704f

Browse files
authored
Merge pull request #236 from ITISFoundation/fix-job-collection
fix: job collections where not being fetched correctly
2 parents 2e134b2 + 6ec6ccc commit 495704f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

node/src/components/data/JobSelector.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export default function JobsSelector(props: JobSelectorPropsType) {
121121
if (fetchedJobCollections.length > 0 && !forceFetch) {
122122
console.info("Job collections already fetched, skipping fetch.");
123123
setJobCollections(fetchedJobCollections);
124+
setLoading(false);
124125
return;
125126
}
126127

@@ -135,6 +136,7 @@ export default function JobsSelector(props: JobSelectorPropsType) {
135136
if (equalJC) {
136137
console.info("Job collections already fetched, skipping fetch.");
137138
setJobCollections(fetchedJobCollections);
139+
setLoading(false);
138140
return;
139141
}
140142

@@ -287,7 +289,8 @@ export default function JobsSelector(props: JobSelectorPropsType) {
287289

288290
useEffect(() => {
289291
console.info("useEffect in JobsSelector triggered");
290-
if (selectedFunction !== undefined && jobCollections.length > 0) {
292+
if (selectedFunction === undefined || jobCollections.length > 0) {
293+
} else {
291294
console.info("Function selected: ", selectedFunction.uid);
292295
(async () => {
293296
setJobCollections([]);

0 commit comments

Comments
 (0)