diff --git a/packages/openchs-android/src/action/program/ProgramEnrolmentActions.js b/packages/openchs-android/src/action/program/ProgramEnrolmentActions.js index 3f09167ac..98d56854a 100644 --- a/packages/openchs-android/src/action/program/ProgramEnrolmentActions.js +++ b/packages/openchs-android/src/action/program/ProgramEnrolmentActions.js @@ -24,7 +24,6 @@ export class ProgramEnrolmentActions { } static onLoad(state: ProgramEnrolmentState, action, context) { - if (ProgramEnrolmentState.hasEnrolmentOrItsUsageChanged(state, action) || action.forceLoad) { const enrolment = action.enrolment.cloneForEdit(); const formMappingService = context.get(FormMappingService); const isProgramEnrolment = action.usage === ProgramEnrolmentState.UsageKeys.Enrol; @@ -68,9 +67,6 @@ export class ProgramEnrolmentActions { programEnrolmentState.groupAffiliation.removeMemberFromGroup(); } return QuickFormEditingActions.moveToPage(programEnrolmentState, action, context, ProgramEnrolmentActions); - } else { - return state.clone(); - } } static enrolmentDateTimeChanged(state, action, context) { diff --git a/packages/openchs-android/src/state/ProgramEnrolmentState.js b/packages/openchs-android/src/state/ProgramEnrolmentState.js index 382404d56..cb8ad1a90 100644 --- a/packages/openchs-android/src/state/ProgramEnrolmentState.js +++ b/packages/openchs-android/src/state/ProgramEnrolmentState.js @@ -79,13 +79,6 @@ class ProgramEnrolmentState extends AbstractDataEntryState { return this.wizard.isFirstPage() ? validationKeys : []; } - static hasEnrolmentOrItsUsageChanged(state, action) { - return _.isNil(state) || - _.isNil(state.enrolment) || - state.enrolment.uuid !== action.enrolment.uuid || - state.usage !== action.usage; - } - validateEntity(context) { let validationResults; if (this.usage === ProgramEnrolmentState.UsageKeys.Enrol) { diff --git a/packages/openchs-android/src/views/program/ProgramEnrolmentView.js b/packages/openchs-android/src/views/program/ProgramEnrolmentView.js index 2b9ec9632..4e4a84c1b 100644 --- a/packages/openchs-android/src/views/program/ProgramEnrolmentView.js +++ b/packages/openchs-android/src/views/program/ProgramEnrolmentView.js @@ -56,14 +56,13 @@ class ProgramEnrolmentView extends AbstractComponent { enrolment: this.props.enrolment, usage: ProgramEnrolmentView.usageContext.usage, workLists: this.props.workLists, - forceLoad: this.props.editing, pageNumber: this.props.pageNumber, }); return super.UNSAFE_componentWillMount(); } onBack() { - this.dispatchAction(Actions.ON_LOAD, {enrolment: this.props.enrolment, usage: ProgramEnrolmentView.usageContext.usage, forceLoad: true}); + this.dispatchAction(Actions.ON_LOAD, {enrolment: this.props.enrolment, usage: ProgramEnrolmentView.usageContext.usage}); this.goBack(); }