Skip to content

Commit

Permalink
CORE-4518: new user fix (#1081) (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekachxaidze98 authored Jan 22, 2024
1 parent 79b62b6 commit f9b3020
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions design-v2/benefits/benefitsForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ const BenefitsForm = React.forwardRef(({ onSubmit, setModalActive }, ref) => {
useEffect(() => {
if (
(dataProvidersResponse.error &&
dataProvidersResponse.error.length > 1 &&
dataProvidersResponse.existingDataProviders &&
dataProvidersResponse.error.length >= 1 &&
!dataProvidersResponse.existingDataProviders &&
dataProvidersResponse.existingDataProviders.length === 0) ||
dataProvidersResponse?.error?.status === 500
) {
Expand All @@ -99,31 +99,26 @@ const BenefitsForm = React.forwardRef(({ onSubmit, setModalActive }, ref) => {
)
} else if (
(dataProvidersResponse.existingDataProviders &&
dataProvidersResponse.existingDataProviders.length > 1) ||
dataProvidersResponse.existingDataProviders.length >= 1) ||
dataProvidersResponse?.error?.status === 409
) {
setFormSubmitted(true)
setModalContent(
<BenefitsStep
subTitle={benefitsData.secondStep.member.subTitle}
description={`You can find data provider’s content at [https://core.ac.uk/search?q=dataProviders:{{ data_provider_id }}](https://core.ac.uk/search?q=dataProviders:${
description={`You can find data provider’s content at [CORE search](https://core.ac.uk/search?q=dataProviders:${
getId || GetParsedId
}). Also here you can find data provider [{{https://core.ac.uk/data-providers/??}}](https://core.ac.uk/data-providers/${
}). Also here you can find data provider [data provider profile](https://core.ac.uk/data-providers/${
getId || GetParsedId
}) profile page on the CORE website.<br/><br/>
}) page on the CORE website.<br/><br/>
**Please note**, that if you have submitted this repository recently it may not appear on the search results. Please wait until harvesting will be completed. [Find out more](documentation/data-providers-guide#indexing).
`}
setModalContent={setModalContent}
setFormSubmitted={setFormSubmitted}
onCloseModal={onCloseModal}
/>
)
} else if (
(dataProvidersResponse.error &&
dataProvidersResponse.error.length === 0) ||
(dataProvidersResponse.length >= 1 &&
!dataProvidersResponse?.error?.status)
) {
} else if (dataProvidersResponse.id) {
setFormSubmitted(true)
setModalContent(
<BenefitsStep
Expand All @@ -136,7 +131,11 @@ const BenefitsForm = React.forwardRef(({ onSubmit, setModalActive }, ref) => {
/>
)
}
}, [dataProvidersResponse, dataProvidersResponse?.error?.status])
}, [
dataProvidersResponse?.id,
dataProvidersResponse?.existingDataProviders,
dataProvidersResponse?.error?.status,
])

return (
<>
Expand Down

0 comments on commit f9b3020

Please sign in to comment.