Skip to content

Commit

Permalink
Fix library id issue causing error when submitting collabs
Browse files Browse the repository at this point in the history
  • Loading branch information
thostetler committed Nov 23, 2020
1 parent a42387d commit e08b89e
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 e08b89e

Please sign in to comment.