TP-66615 | App Crashes fixes (#816)
This commit is contained in:
@@ -20,16 +20,12 @@ interface IRenderQuestion {
|
||||
|
||||
const RenderQuestion: React.FC<IRenderQuestion> = (props) => {
|
||||
const { name, questionMap, journeyId, caseId, sectionId, setValue } = props;
|
||||
const caseType = useAppSelector(
|
||||
(state) =>
|
||||
state.allCases.caseDetails[caseId]?.caseType || CaseAllocationType.ADDRESS_VERIFICATION_CASE
|
||||
);
|
||||
const template = useAppSelector((state) => state.case.templateData[caseType]);
|
||||
const questionHashMap = template.questions;
|
||||
const template = useAppSelector((state) => state.case.templateData[CaseAllocationType.COLLECTION_CASE]);
|
||||
const questionHashMap = template?.questions;
|
||||
return (
|
||||
<View>
|
||||
{questionMap.map((question, index) => {
|
||||
if (questionHashMap[question as keyof typeof questionHashMap]) {
|
||||
{questionMap?.map((question, index) => {
|
||||
if (questionHashMap?.[question as keyof typeof questionHashMap]) {
|
||||
return (
|
||||
<QuestionRenderingEngine
|
||||
key={index}
|
||||
|
||||
@@ -87,7 +87,7 @@ const Submit: React.FC<ISubmit> = (props) => {
|
||||
<View key={section}>
|
||||
{sections?.[section]?.questions?.map((question: string) => {
|
||||
const answer =
|
||||
data.widgetContext[visited].sectionContext[section].questionContext[
|
||||
data?.widgetContext?.[visited]?.sectionContext?.[section]?.questionContext?.[
|
||||
question
|
||||
];
|
||||
return answer ? (
|
||||
|
||||
@@ -33,7 +33,8 @@ export const getVisitedWidgetsNodeList = (
|
||||
|
||||
export const getNextWidget = (conditionActions: ConditionAction[], context: any): string => {
|
||||
let nextScreenName = '';
|
||||
for (const conditionAction of conditionActions) {
|
||||
const updatedConditionActions = conditionActions || [];
|
||||
for (const conditionAction of updatedConditionActions) {
|
||||
if (
|
||||
conditionAction.isDefault ||
|
||||
(conditionAction.condition && evaluateCondition(conditionAction.condition, context))
|
||||
|
||||
@@ -101,7 +101,7 @@ export const linkingConf: LinkingOptions<GenericType> = {
|
||||
return null;
|
||||
}
|
||||
const caseId = message?.notification?.data?.caseId as string;
|
||||
const reduxState = store.getState();
|
||||
const reduxState = store?.getState();
|
||||
const caseDetails = reduxState?.allCases?.caseDetails?.[caseId];
|
||||
const notificationId = message?.notification?.data?.notificationId as string;
|
||||
const deepLink = message?.notification?.data?.deepLinks?.[message?.pressAction?.id] as string;
|
||||
|
||||
@@ -454,7 +454,7 @@ const FEEDBACK_FILTER_NAME = 'FEEDBACK';
|
||||
const FEEDBACK_FILTER_VALUE = 'PROMISE_TO_PAY';
|
||||
|
||||
function getFilterSelectionForPtpFilter(filterName: string, filterValue: string) {
|
||||
const selectedFilters = {...store.getState()?.filters?.selectedFilters || {}};
|
||||
const selectedFilters = {...store?.getState()?.filters?.selectedFilters || {}};
|
||||
if (selectedFilters[filterName]) {
|
||||
selectedFilters[filterName][filterValue] = true;
|
||||
} else {
|
||||
@@ -493,7 +493,7 @@ export const handleNotificationNavigation = (
|
||||
action: string
|
||||
) => {
|
||||
const { caseId, notificationId } = data || {};
|
||||
const reduxState = store.getState();
|
||||
const reduxState = store?.getState();
|
||||
const phoneNumber = (data?.phoneNumber as string) || '';
|
||||
const caseDetails = reduxState?.allCases?.caseDetails?.[caseId as string];
|
||||
const templateName = data?.templateName as string;
|
||||
|
||||
@@ -12,7 +12,7 @@ import { ProfileScreenStackEnum } from '../ProfileStack';
|
||||
import CountComponent from '../CountComponent';
|
||||
|
||||
export const getNavigationLinks = () => {
|
||||
const { isTeamLead, selectedAgent, featureFlags } = store.getState().user;
|
||||
const { isTeamLead, selectedAgent, featureFlags } = store?.getState().user;
|
||||
return [
|
||||
{
|
||||
name: 'Completed cases',
|
||||
|
||||
Reference in New Issue
Block a user