Skip to content

Commit

Permalink
Merge pull request #2087 from thostetler/fix-lib-id-issue
Browse files Browse the repository at this point in the history
Fix library id issue causing error when submitting collabs
  • Loading branch information
thostetler committed Nov 24, 2020
2 parents a42387d + e08b89e commit 172aa82
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/js/react/LibraryCollaborators/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ define(['underscore', 'redux', './constants', './actions'], function(
owner: null,
};
const library = (state = libraryState, action) => {
if (action.type === SET_LIBRARY_DATA && action.payload) {
return {
id: action.payload.id || state.id,
name: action.payload.name || state.name,
owner: action.payload.owner || state.owner,
};
if (action.type === SET_LIBRARY_DATA && action.result) {
const {
result: { id = state.id, name = state.name, owner = state.owner },
} = action;
return { id, name, owner };
}
return state;
};
Expand Down

0 comments on commit 172aa82

Please sign in to comment.