Skip to content
Snippets Groups Projects
Commit 5f977142 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

fix(dashboard): refresh card after closing invite reviewers modal

parent 91cc7d79
No related branches found
No related tags found
1 merge request!13Sprint #14
......@@ -98,6 +98,7 @@ export default compose(
onConfirm: () =>
assignHandlingEditor(get(editor, 'email'), project.id, true).then(
() => {
getCollections()
hideModal()
showModal({
type: 'success',
......
import React, { Fragment } from 'react'
import { connect } from 'react-redux'
import { actions } from 'pubsweet-client'
import styled, { css } from 'styled-components'
import { Icon, Button, th, Spinner } from '@pubsweet/ui'
import { compose, withHandlers, lifecycle } from 'recompose'
......@@ -31,7 +32,7 @@ const InviteReviewersModal = compose(
fetchingInvite: selectFetchingInvite(state),
fetchingReviewers: selectFetchingReviewers(state),
}),
{ getCollectionReviewers },
{ getCollectionReviewers, getCollections: actions.getCollections },
),
withHandlers({
getReviewers: ({
......@@ -41,6 +42,10 @@ const InviteReviewersModal = compose(
}) => () => {
getCollectionReviewers(collectionId)
},
closeModal: ({ getCollections, hideModal }) => () => {
getCollections()
hideModal()
},
}),
lifecycle({
componentDidMount() {
......@@ -50,10 +55,10 @@ const InviteReviewersModal = compose(
}),
)(
({
hideModal,
onConfirm,
showModal,
versionId,
closeModal,
collectionId,
getReviewers,
reviewerError,
......@@ -63,7 +68,7 @@ const InviteReviewersModal = compose(
invitations = [],
}) => (
<Root>
<CloseIcon data-test="icon-modal-hide" onClick={hideModal}>
<CloseIcon data-test="icon-modal-hide" onClick={closeModal}>
<Icon primary>x</Icon>
</CloseIcon>
......
......@@ -38,7 +38,7 @@ export const assignHandlingEditor = (email, collectionId) => dispatch => {
},
err => {
dispatch(editorsDone())
return err
throw err
},
)
}
......@@ -57,7 +57,7 @@ export const revokeHandlingEditor = (
},
err => {
dispatch(editorsDone())
return err
throw err
},
)
}
......
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