diff --git a/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/SingleEventRegistrationEntry.component.js b/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/SingleEventRegistrationEntry.component.js index 90047ba753..24340325cb 100644 --- a/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/SingleEventRegistrationEntry.component.js +++ b/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/SingleEventRegistrationEntry.component.js @@ -22,4 +22,3 @@ export const SingleEventRegistrationEntryComponent = ({ showAddRelationship, eve ); }; - diff --git a/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/SingleEventRegistrationEntry.container.js b/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/SingleEventRegistrationEntry.container.js index 3c7d2d66d8..3d88627fb9 100644 --- a/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/SingleEventRegistrationEntry.container.js +++ b/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/SingleEventRegistrationEntry.container.js @@ -13,13 +13,14 @@ import { defaultDialogProps as dialogConfig } from '../../Dialogs/DiscardDialog. import { getOpenDataEntryActions } from './DataEntryWrapper/DataEntry'; import type { ContainerProps, StateProps, MapStateToProps } from './SingleEventRegistrationEntry.types'; import { useCategoryCombinations } from '../../DataEntryDhis2Helpers/AOC/useCategoryCombinations'; +import { itemId } from './DataEntryWrapper/DataEntry/helpers/constants'; const inEffect = (state: ReduxState) => dataEntryHasChanges(state, 'singleEvent-newEvent') || state.newEventPage.showAddRelationship; const makeMapStateToProps = (): MapStateToProps => { const eventAccessSelector = makeEventAccessSelector(); return (state: ReduxState, { id }: ContainerProps): StateProps => ({ - ready: state.dataEntries[id], + ready: state.dataEntries[id]?.itemId === itemId, showAddRelationship: !!state.newEventPage.showAddRelationship, eventAccess: eventAccessSelector(state), });