Skip to content

Commit 51d0519

Browse files
author
Javier Garcia Ordonez
committed
FIX: fixing logic JobSelector
1 parent 8557103 commit 51d0519

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

node/src/components/data/JobSelector.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,16 @@ export default function JobsSelector(props: JobSelectorPropsType) {
289289

290290
useEffect(() => {
291291
console.info("useEffect in JobsSelector triggered");
292-
if (selectedFunction === undefined || jobCollections.length > 0) {
293-
} else {
294-
console.info("Function selected: ", selectedFunction.uid);
295-
(async () => {
296-
setJobCollections([]);
297-
await updateJobCollections(selectedFunction?.uid as string);
298-
console.info("Updated JobCollections");
299-
})();
292+
if (selectedFunction === undefined || jobCollections.length === 0) {
293+
return;
300294
}
295+
console.info("Function selected: ", selectedFunction.uid);
296+
(async () => {
297+
setJobCollections([]);
298+
await updateJobCollections(selectedFunction?.uid as string);
299+
console.info("Updated JobCollections");
300+
})();
301+
301302
console.info("Function selected: ", selectedFunction.uid);
302303
(async () => {
303304
setJobCollections([]);

0 commit comments

Comments
 (0)