Skip to content

Commit 8bd5fe3

Browse files
authored
Merge pull request #29 from Visual-Regression-Tracker/75-navigate-by-url
url navigation fixed
2 parents 367c8c6 + 93b937e commit 8bd5fe3

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/components/BuildList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const BuildList: FunctionComponent = () => {
102102
onClick={() => {
103103
deleteBuild(buildDispatch, build.id)
104104
.then((b) =>
105-
enqueueSnackbar(`${b.id} removed`, {
105+
enqueueSnackbar(`${b.id} deleted`, {
106106
variant: "success",
107107
})
108108
)

src/pages/ProjectPage.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ const ProjectPage = () => {
7373
const buildDispatch = useBuildDispatch();
7474
const {
7575
testRuns,
76-
selectedTestRunId,
7776
selectedTestRunIndex,
7877
} = useTestRunState();
7978
const testRunDispatch = useTestRunDispatch();
@@ -109,21 +108,19 @@ const ProjectPage = () => {
109108

110109
useEffect(() => {
111110
const queryParams = getQueryParams(location.search);
112-
if (!selectedBuildId) {
113-
if (queryParams.buildId) {
114-
selectBuild(buildDispatch, queryParams.buildId);
115-
} else if (buildList.length > 0) {
116-
selectBuild(buildDispatch, buildList[0].id);
117-
}
111+
if (queryParams.buildId) {
112+
selectBuild(buildDispatch, queryParams.buildId);
113+
} else if (buildList.length > 0) {
114+
selectBuild(buildDispatch, buildList[0].id);
118115
}
119-
}, [buildDispatch, buildList, location.search, selectedBuildId]);
116+
}, [buildDispatch, buildList, location.search]);
120117

121118
useEffect(() => {
122119
const queryParams = getQueryParams(location.search);
123-
if (!selectedTestRunId && queryParams.testId) {
120+
if (queryParams.testId) {
124121
selectTestRun(testRunDispatch, queryParams.testId);
125122
}
126-
}, [location.search, testRuns, selectedTestRunId, testRunDispatch]);
123+
}, [location.search, testRuns, testRunDispatch]);
127124

128125
useEffect(() => {
129126
setFilteredTestRuns(

0 commit comments

Comments
 (0)