Skip to content

Commit c29f5c7

Browse files
committed
fix: Require file prop in Qualification
1 parent 651be00 commit c29f5c7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

react/Viewer/Panel/Qualification.jsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ const makeQualificationListItemComp = metadataName => {
3737
}
3838
}
3939

40-
const Qualification = ({ file = {} }) => {
40+
const isExpirationAlertHidden = file => {
41+
return file?.metadata?.hideExpirationAlert ?? false
42+
}
43+
44+
const Qualification = ({ file }) => {
4145
const { metadata = {} } = file
4246
const actionBtnRef = useRef([])
4347
const [optionFile, setOptionFile] = useState({
@@ -69,7 +73,7 @@ const Qualification = ({ file = {} }) => {
6973

7074
return (
7175
<>
72-
{isExpiringSoon(file) && !file?.metadata?.hideExpirationAlert && (
76+
{isExpiringSoon(file) && !isExpirationAlertHidden(file) && (
7377
<ExpirationAlert file={file} />
7478
)}
7579
<List className={'u-pv-1'}>
@@ -102,7 +106,7 @@ const Qualification = ({ file = {} }) => {
102106
}
103107

104108
Qualification.propTypes = {
105-
file: PropTypes.object
109+
file: PropTypes.object.isRequired
106110
}
107111

108112
export default withViewerLocales(Qualification)

0 commit comments

Comments
 (0)