|
@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
|
|
|
import { useSelector, useDispatch } from 'react-redux';
|
|
|
import { ExtendedBodyPosition } from '../../../states/exam/bodyPositionListSlice';
|
|
|
import { RootState, AppDispatch } from '../../../states/store';
|
|
|
-import { Button, Image } from 'antd';
|
|
|
+import { Button, Image, message } from 'antd';
|
|
|
import AppendViewIcon from '@/assets/imgs/append-view.svg';
|
|
|
import ImageViewer from './ImageViewer';
|
|
|
import { getExposedImageUrl, getViewIconUrl } from '../../../API/bodyPosition';
|
|
@@ -41,7 +41,14 @@ const BodyPositionList: React.FC<BodyPositionListProps> = ({
|
|
|
console.log(
|
|
|
'[BodyPositionList] Auto-selecting first body position on component mount'
|
|
|
);
|
|
|
- autoSelectFirstBodyPosition(bodyPositions, dispatch, currentKey);
|
|
|
+ autoSelectFirstBodyPosition(bodyPositions, dispatch, currentKey).catch(
|
|
|
+ (error) => {
|
|
|
+ message.error(
|
|
|
+ 'Failed to auto-select the first body position 00000',
|
|
|
+ error
|
|
|
+ );
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
}, [bodyPositions, selectedBodyPosition, dispatch, currentKey]);
|
|
|
|