From 93b937e71466194502e99606391ecc60ff203f3d Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Sun, 19 Jul 2020 21:54:53 +0200 Subject: [PATCH] url navigation fixed --- src/components/BuildList.tsx | 2 +- src/pages/ProjectPage.tsx | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/components/BuildList.tsx b/src/components/BuildList.tsx index 04186446..156a6645 100644 --- a/src/components/BuildList.tsx +++ b/src/components/BuildList.tsx @@ -102,7 +102,7 @@ const BuildList: FunctionComponent = () => { onClick={() => { deleteBuild(buildDispatch, build.id) .then((b) => - enqueueSnackbar(`${b.id} removed`, { + enqueueSnackbar(`${b.id} deleted`, { variant: "success", }) ) diff --git a/src/pages/ProjectPage.tsx b/src/pages/ProjectPage.tsx index 3fbf1196..1c2a03fb 100644 --- a/src/pages/ProjectPage.tsx +++ b/src/pages/ProjectPage.tsx @@ -73,7 +73,6 @@ const ProjectPage = () => { const buildDispatch = useBuildDispatch(); const { testRuns, - selectedTestRunId, selectedTestRunIndex, } = useTestRunState(); const testRunDispatch = useTestRunDispatch(); @@ -109,21 +108,19 @@ const ProjectPage = () => { useEffect(() => { const queryParams = getQueryParams(location.search); - if (!selectedBuildId) { - if (queryParams.buildId) { - selectBuild(buildDispatch, queryParams.buildId); - } else if (buildList.length > 0) { - selectBuild(buildDispatch, buildList[0].id); - } + if (queryParams.buildId) { + selectBuild(buildDispatch, queryParams.buildId); + } else if (buildList.length > 0) { + selectBuild(buildDispatch, buildList[0].id); } - }, [buildDispatch, buildList, location.search, selectedBuildId]); + }, [buildDispatch, buildList, location.search]); useEffect(() => { const queryParams = getQueryParams(location.search); - if (!selectedTestRunId && queryParams.testId) { + if (queryParams.testId) { selectTestRun(testRunDispatch, queryParams.testId); } - }, [location.search, testRuns, selectedTestRunId, testRunDispatch]); + }, [location.search, testRuns, testRunDispatch]); useEffect(() => { setFilteredTestRuns(