TP-71465 | JS Crash fixes (#924)
This commit is contained in:
@@ -41,10 +41,7 @@ export enum DateValue {
|
||||
|
||||
const DateInput: React.FC<IDateInput> = (props) => {
|
||||
const { questionId, error, sectionId, widgetId, caseId, questionType } = props;
|
||||
const caseType = useAppSelector(
|
||||
(state) =>
|
||||
state.allCases.caseDetails[caseId]?.caseType || CaseAllocationType.ADDRESS_VERIFICATION_CASE
|
||||
);
|
||||
const caseType = CaseAllocationType.COLLECTION_CASE;
|
||||
const template = useAppSelector((state) => state.case.templateData[caseType]);
|
||||
|
||||
const question = template.questions[questionId as keyof typeof template.questions];
|
||||
|
||||
@@ -33,10 +33,7 @@ const DEFAULT_TIME = '09:00';
|
||||
|
||||
const TimeInput: React.FC<ITimeInput> = (props) => {
|
||||
const { questionId, error, sectionId, widgetId, caseId, questionType } = props;
|
||||
const caseType = useAppSelector(
|
||||
(state) =>
|
||||
state.allCases.caseDetails[caseId]?.caseType || CaseAllocationType.ADDRESS_VERIFICATION_CASE
|
||||
);
|
||||
const caseType = CaseAllocationType.COLLECTION_CASE;
|
||||
const template = useAppSelector((state) => state.case.templateData[caseType]);
|
||||
|
||||
const question = template.questions[questionId as keyof typeof template.questions];
|
||||
|
||||
@@ -41,25 +41,10 @@ const GeolocationContainer: React.FC<IGeolocationContainer> = ({
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (!geolocationList?.length) {
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
styles.noGeolocationContainer,
|
||||
GenericStyles.centerAligned,
|
||||
GenericStyles.columnDirection,
|
||||
]}
|
||||
>
|
||||
<CustomLocationIcon />
|
||||
<Text style={[styles.textContainer, styles.noGeolocationText]}>No geo location found</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const { nearbyLocations, farAwayLocations } = useMemo(() => {
|
||||
const nearbyLocations: IGeolocation[] = [];
|
||||
const farAwayLocations: IGeolocation[] = [];
|
||||
geolocationList.forEach((geolocation: IGeolocation) => {
|
||||
geolocationList?.forEach((geolocation: IGeolocation) => {
|
||||
const distance = getDistanceFromLatLonInKm(currentGeolocationCoordinates, {
|
||||
latitude: geolocation?.latitude,
|
||||
longitude: geolocation?.longitude,
|
||||
@@ -89,6 +74,21 @@ const GeolocationContainer: React.FC<IGeolocationContainer> = ({
|
||||
});
|
||||
};
|
||||
|
||||
if (!geolocationList?.length) {
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
styles.noGeolocationContainer,
|
||||
GenericStyles.centerAligned,
|
||||
GenericStyles.columnDirection,
|
||||
]}
|
||||
>
|
||||
<CustomLocationIcon />
|
||||
<Text style={[styles.textContainer, styles.noGeolocationText]}>No geo location found</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={[GenericStyles.fill]}>
|
||||
{nearbyLocations?.length ? (
|
||||
|
||||
Reference in New Issue
Block a user