From ecf0516b3983000f0d892ace814ae2f414c785d6 Mon Sep 17 00:00:00 2001 From: Dunemask Date: Sun, 14 Aug 2022 11:09:06 +0000 Subject: [PATCH] Fixed redirect bug --- src/views/jobs/Jobs.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/jobs/Jobs.jsx b/src/views/jobs/Jobs.jsx index 18f63c4..be42d18 100644 --- a/src/views/jobs/Jobs.jsx +++ b/src/views/jobs/Jobs.jsx @@ -21,7 +21,7 @@ export default function Jobs() { function jobHashLoader() { const { hash } = location; - if (!hash) return {}; + if (!hash) return { hash }; const jobIndex = hash.indexOf(jobViewPrefix); const pipelineIndex = hash.indexOf(pipelineViewPrefix); const cacheIndex = hash.indexOf(cachePrefix); @@ -34,13 +34,14 @@ export default function Jobs() { ? null : jobState.pipelines.find((p) => p.id === pipelineId); const builderCache = !cacheData ? null : { fakedata: "yep" }; - return { job, pipeline, builderCache }; + return { job, pipeline, builderCache, hash }; } const jobHash = jobHashLoader(); useEffect(() => { - const { job, pipeline, builderCache } = jobHash; + const { job, pipeline, builderCache, hash } = jobHash; + if (!hash) return; if (!job && !pipeline && !builderCache) navigate("/qualiteer/jobs"); });