Fixed client disconnect and navigation glitch
This commit is contained in:
parent
ecf0516b39
commit
a3cb448a7b
8 changed files with 34 additions and 39 deletions
|
@ -1,5 +1,5 @@
|
|||
import React, { useContext, useState, useEffect } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useJobNav } from "@qltr/util/JobTools";
|
||||
import JobContext, { jobStatus } from "@qltr/jobs";
|
||||
import StoreContext from "@qltr/store";
|
||||
import Box from "@mui/material/Box";
|
||||
|
@ -23,10 +23,10 @@ import PlayArrowIcon from "@mui/icons-material/PlayArrow";
|
|||
import ViewColumnIcon from "@mui/icons-material/ViewColumn";
|
||||
|
||||
export default function JobView(props) {
|
||||
const navigate = useNavigate();
|
||||
const { job } = props;
|
||||
const { jobFactory, jobCancel, jobDestroy } = useContext(JobContext);
|
||||
const { state: store } = useContext(StoreContext);
|
||||
const jobNav = useJobNav();
|
||||
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||
const open = Boolean(anchorEl);
|
||||
const handleClick = (event) => {
|
||||
|
@ -51,7 +51,7 @@ export default function JobView(props) {
|
|||
|
||||
function retryJob() {
|
||||
const jobId = jobFactory(job.builderCache);
|
||||
if (store.focusJob) navigate(`/qualiteer/jobs#${jobId}`);
|
||||
if (store.focusJob) jobNav.toJob(jobId);
|
||||
}
|
||||
|
||||
function downloadLog() {
|
||||
|
@ -74,8 +74,8 @@ export default function JobView(props) {
|
|||
};
|
||||
|
||||
function navigateToJobs() {
|
||||
if (job.isPipeline) return navigate(`/qualiteer/jobs#p${job.pipelineId}`);
|
||||
navigate("/qualiteer/jobs");
|
||||
if (job.isPipeline) return jobNav.toPipeline(job.pipelineId);
|
||||
jobNav.toJobs();
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue