Skip to content

Commit bf75ef0

Browse files
authored
Avoid duplicated entries displayed in classpath page (#1319)
1 parent 96eb385 commit bf75ef0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/classpath/assets/features/classpathConfiguration/classpathConfigurationViewSlice.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const classpathConfigurationViewSlice = createSlice({
5858
}
5959
},
6060
updateSource: (state, action) => {
61-
state.sources[state.activeProjectIndex] = action.payload;
61+
state.sources[state.activeProjectIndex] = _.uniqBy(action.payload as ClasspathEntry[], "path");
6262
},
6363
setOutputPath: (state, action) => {
6464
state.output[state.activeProjectIndex] = action.payload;
@@ -79,8 +79,7 @@ export const classpathConfigurationViewSlice = createSlice({
7979
addLibraries: (state, action) => {
8080
let newLibs = state.libraries[state.activeProjectIndex];
8181
newLibs.unshift(...action.payload);
82-
newLibs = _.uniq(newLibs);
83-
state.libraries[state.activeProjectIndex] = _.uniq(newLibs);
82+
state.libraries[state.activeProjectIndex] = _.uniqBy(newLibs, "path");
8483
},
8584
catchException: (state, action) => {
8685
state.exception = action.payload;

0 commit comments

Comments
 (0)