NTP-34955 | optional chaining for case id (#1083)

Co-authored-by: varnit goyal <github.cicd@navi.com>
Co-authored-by: yashmantri <mantri.ramkishor@navi.com>
This commit is contained in:
Varnit Goyal
2025-02-04 16:53:26 +05:30
committed by GitHub
parent 67265831f0
commit 5d77721dd8
3 changed files with 6 additions and 6 deletions

View File

@@ -85,12 +85,12 @@ export const generateOTP =
.catch((err) => {
// TODO: Fix status from BE
if (
err.response.status === API_STATUS_CODE.NOT_FOUND ||
err.response.status === API_STATUS_CODE.BAD_REQUEST
err?.response?.status === API_STATUS_CODE.NOT_FOUND ||
err?.response?.status === API_STATUS_CODE.BAD_REQUEST
) {
dispatch(setOTPError('Enter a registered mobile number'));
} else {
dispatch(setOTPError(err.response?.data?.message));
dispatch(setOTPError(err?.response?.data?.message));
}
})
.finally(() => dispatch(setFormLoading(false)));

View File

@@ -54,7 +54,7 @@ const PhoneNumberSelection: React.FC<IPhoneNumberSelection> = (props) => {
return (
<View style={GenericStyles.mt12}>
<Text dark bold>
{question.text}{' '}
{question?.text || ' '}
{isQuestionMandatory(question) && <Text style={GenericStyles.redText}>*</Text>}
</Text>
<SuspenseLoader
@@ -62,7 +62,7 @@ const PhoneNumberSelection: React.FC<IPhoneNumberSelection> = (props) => {
fallBack={
<>
{[...Array(6).keys()].map(() => (
<LineLoader width="100%" height={65} style={[GenericStyles.mv8]} />
<LineLoader width="100%" height={65} style={GenericStyles.mv8} />
))}
</>
}

View File

@@ -43,7 +43,7 @@ const CollectionCaseDetails: React.FC<ICaseDetails> = (props) => {
params: { caseId, notificationId },
},
} = props;
const caseDetail = useAppSelector((state: RootState) => state.allCases.caseDetails[caseId]) || {};
const caseDetail = useAppSelector((state: RootState) => state.allCases.caseDetails?.[caseId]) || {};
const isCallActive = useAppSelector(
(state: RootState) => state?.activeCall?.activeCallDetails?.callActive
);