|
@@ -40,17 +40,24 @@ const BodyPositionList: React.FC<BodyPositionListProps> = ({
|
|
|
sid: bodyPosition.sid,
|
|
|
})
|
|
|
);
|
|
|
- changeBodyPosition(bodyPosition.sop_instance_uid)
|
|
|
- .then(() => {
|
|
|
- message.success(
|
|
|
- `'Body position changed successfully' ${bodyPosition.sop_instance_uid}`
|
|
|
- );
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- console.error('Error changing body position:', error);
|
|
|
- message.error('Failed to change body position');
|
|
|
- });
|
|
|
+ if (currentKey === 'exam') {
|
|
|
+ changeBodyPosition(bodyPosition.sop_instance_uid)
|
|
|
+ .then(() => {
|
|
|
+ message.success(
|
|
|
+ `'Body position changed successfully' ${bodyPosition.sop_instance_uid}`
|
|
|
+ );
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error('Error changing body position:', error);
|
|
|
+ message.error('Failed to change body position');
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // message.info(`Current key is ${currentKey}, not executing changeBodyPosition.`);
|
|
|
+ }
|
|
|
};
|
|
|
+ const currentKey = useSelector(
|
|
|
+ (state: RootState) => state.BusinessFlow.currentKey
|
|
|
+ );
|
|
|
const bodyPositions = useSelector(
|
|
|
(state: RootState) => state.bodyPositionList.bodyPositions
|
|
|
);
|