Fixed redirect bug
This commit is contained in:
parent
311cc229e9
commit
ecf0516b39
1 changed files with 4 additions and 3 deletions
|
@ -21,7 +21,7 @@ export default function Jobs() {
|
||||||
|
|
||||||
function jobHashLoader() {
|
function jobHashLoader() {
|
||||||
const { hash } = location;
|
const { hash } = location;
|
||||||
if (!hash) return {};
|
if (!hash) return { hash };
|
||||||
const jobIndex = hash.indexOf(jobViewPrefix);
|
const jobIndex = hash.indexOf(jobViewPrefix);
|
||||||
const pipelineIndex = hash.indexOf(pipelineViewPrefix);
|
const pipelineIndex = hash.indexOf(pipelineViewPrefix);
|
||||||
const cacheIndex = hash.indexOf(cachePrefix);
|
const cacheIndex = hash.indexOf(cachePrefix);
|
||||||
|
@ -34,13 +34,14 @@ export default function Jobs() {
|
||||||
? null
|
? null
|
||||||
: jobState.pipelines.find((p) => p.id === pipelineId);
|
: jobState.pipelines.find((p) => p.id === pipelineId);
|
||||||
const builderCache = !cacheData ? null : { fakedata: "yep" };
|
const builderCache = !cacheData ? null : { fakedata: "yep" };
|
||||||
return { job, pipeline, builderCache };
|
return { job, pipeline, builderCache, hash };
|
||||||
}
|
}
|
||||||
|
|
||||||
const jobHash = jobHashLoader();
|
const jobHash = jobHashLoader();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { job, pipeline, builderCache } = jobHash;
|
const { job, pipeline, builderCache, hash } = jobHash;
|
||||||
|
if (!hash) return;
|
||||||
if (!job && !pipeline && !builderCache) navigate("/qualiteer/jobs");
|
if (!job && !pipeline && !builderCache) navigate("/qualiteer/jobs");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue