Skip to content

Commit ba0f367

Browse files
authored
Fix of Issue#255 :Changing projects does not refresh the test run screen (#170)
1 parent d56fa32 commit ba0f367

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/BuildList/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ const BuildList: FunctionComponent = () => {
8686
};
8787

8888
React.useEffect(() => {
89-
if (!selectedBuild && buildList.length > 0) {
90-
selectBuild(buildDispatch, buildList[0].id);
89+
if (!selectedBuild || selectedBuild.projectId !== selectedProjectId) {
90+
const buildId = buildList.length > 0 ? buildList[0].id : null;
91+
selectBuild(buildDispatch, buildId);
9192
}
92-
}, [buildDispatch, selectedBuild, buildList]);
93+
}, [buildDispatch, selectedBuild, buildList, selectedProjectId]);
9394

9495
const getBuildListCalback: any = React.useCallback(
9596
(page: number) =>

0 commit comments

Comments
 (0)