Skip to content

Commit

Permalink
Fix for duplicate spindle listings
Browse files Browse the repository at this point in the history
  • Loading branch information
kglovern committed Feb 22, 2024
1 parent f07a265 commit 40f2d54
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/reducers/controllerReducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,13 @@ const reducer = createReducer(initialState, {
};
},
[ADD_SPINDLE]: (payload, reducerState) => {
const currentSpindles = reducerState.spindles;

let otherSpindles = currentSpindles.filter((spindle) => spindle.id !== payload.id);

return {
spindles: [
...reducerState.spindles,
...otherSpindles,
payload
]
};
Expand Down

0 comments on commit 40f2d54

Please sign in to comment.