Skip to content

Commit b17f434

Browse files
committed
Check that type hasn't stayed the same
1 parent 9feb23a commit b17f434

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,15 @@ export class PfrsProposalComponent extends FilesStepComponent implements OnInit,
461461
const changingToResidentialType = newType && residentialTypes.includes(newType);
462462

463463
return !!(
464-
(oldType &&
464+
oldType !== newType &&
465+
((oldType &&
465466
oldType === STRUCTURE_TYPES.FARM_STRUCTURE &&
466467
(this.soilAgriParcelActivity.value || this.soilStructureFarmUseReason.value)) ||
467-
(changingFromResidentialType && !changingToResidentialType && this.soilStructureResidentialUseReason.value) ||
468-
(oldType &&
469-
oldType === STRUCTURE_TYPES.ACCESSORY_STRUCTURE &&
470-
this.soilStructureResidentialAccessoryUseReason.value) ||
471-
(oldType && oldType === STRUCTURE_TYPES.OTHER_STRUCTURE && this.soilStructureOtherUseReason.value)
468+
(changingFromResidentialType && !changingToResidentialType && this.soilStructureResidentialUseReason.value) ||
469+
(oldType &&
470+
oldType === STRUCTURE_TYPES.ACCESSORY_STRUCTURE &&
471+
this.soilStructureResidentialAccessoryUseReason.value) ||
472+
(oldType && oldType === STRUCTURE_TYPES.OTHER_STRUCTURE && this.soilStructureOtherUseReason.value))
472473
);
473474
}
474475

0 commit comments

Comments
 (0)