Skip to content

Commit a2ca84b

Browse files
authored
Merge pull request #5463 from SDU-eScience/issue-5146-jobstate
Fixes #5146
2 parents 9caa875 + c8d86e9 commit a2ca84b

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

  • frontend-web/webclient/app/Applications/Jobs

frontend-web/webclient/app/Applications/Jobs/View.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,15 @@ export function View(props: {id?: string; embedded?: boolean;}): React.ReactNode
313313
usePage(`Job ${shortUUID(id)}`, SidebarTabId.RUNS);
314314
}
315315

316+
const [dataAnimationAllowed, setDataAnimationAllowed] = useState<boolean>(false);
317+
const [status, setStatus] = useState<JobStatus | null>(null);
318+
const jobUpdateState = useRef<JobUpdates>({updateQueue: [], logQueue: [], statusQueue: [], subscriptions: []});
319+
const didUnmount = useDidUnmount();
320+
316321
useEffect(() => {
322+
setStatus(null);
323+
setDataAnimationAllowed(false);
324+
jobUpdateState.current = {updateQueue: [], logQueue: [], statusQueue: [], subscriptions: []};
317325
fetchJob(JobsApi.retrieve({
318326
id,
319327
includeApplication: true,
@@ -322,11 +330,6 @@ export function View(props: {id?: string; embedded?: boolean;}): React.ReactNode
322330
}));
323331
}, [id]);
324332

325-
const [dataAnimationAllowed, setDataAnimationAllowed] = useState<boolean>(false);
326-
const [status, setStatus] = useState<JobStatus | null>(null);
327-
const jobUpdateState = useRef<JobUpdates>({updateQueue: [], logQueue: [], statusQueue: [], subscriptions: []});
328-
const didUnmount = useDidUnmount();
329-
330333
const targetRequests = useMemo(() => {
331334
if (!job) return {requestsToMake: [], fixedTargets: []};
332335
return findTargetRequests(job);

0 commit comments

Comments
 (0)