Skip to content
Snippets Groups Projects
Commit 8d62273b authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

(dashboard-card): fix bug when no collections present

parent 42815067
No related branches found
No related tags found
1 merge request!10Sprint #12
...@@ -168,7 +168,8 @@ const DashboardCard = ({ ...@@ -168,7 +168,8 @@ const DashboardCard = ({
const isHEToManuscript = (state, collectionId) => { const isHEToManuscript = (state, collectionId) => {
const currentUserId = get(state, 'currentUser.user.id') const currentUserId = get(state, 'currentUser.user.id')
const collection = state.collections.find(c => c.id === collectionId) || {} const collections = get(state, 'collections') || []
const collection = collections.find(c => c.id === collectionId) || {}
const userInvitation = collection.invitations.find( const userInvitation = collection.invitations.find(
i => i.role === 'handlingEditor' && i.userId === currentUserId, i => i.role === 'handlingEditor' && i.userId === currentUserId,
) )
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment