From e08b89ef43d245a129321a37212958753cb4e994 Mon Sep 17 00:00:00 2001 From: Tim Hostetler Date: Mon, 23 Nov 2020 16:47:26 -0500 Subject: [PATCH] Fix library id issue causing error when submitting collabs --- src/js/react/LibraryCollaborators/reducer.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/js/react/LibraryCollaborators/reducer.js b/src/js/react/LibraryCollaborators/reducer.js index 0154b089c..87c1d347d 100644 --- a/src/js/react/LibraryCollaborators/reducer.js +++ b/src/js/react/LibraryCollaborators/reducer.js @@ -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; };