Code Cleanup v2

This commit is contained in:
Ashish Deo
2023-10-31 22:13:41 +05:30
parent 4446b93427
commit ff05eef827
2 changed files with 4 additions and 4 deletions

View File

@@ -70,8 +70,8 @@ const FeedbackDetailItem = ({
hideAddress,
}: IFeedbackDetailItem) => {
const { agentId, caseDetails } = useAppSelector((state) => ({
agentId: state.user.user?.referenceId || null,
caseDetails: state.allCases.caseDetails?.[caseId] || null,
agentId: state?.user?.user?.referenceId || null,
caseDetails: state?.allCases?.caseDetails?.[caseId] || null,
}));
const [isWhastappSendLoading, setIsWhatsappSendLoading] = useState(false);
const isGeolocation = feedbackItem?.source?.sourceType === VisitType.GEOLOCATION;

View File

@@ -44,8 +44,8 @@ const FeedbackListItem: React.FC<IFeedbackListItem> = ({
};
const [isWhastappSendLoading, setIsWhatsappSendLoading] = useState(false);
const { agentId, caseDetails } = useAppSelector((state) => ({
agentId: state.user.user?.referenceId || null,
caseDetails: state.allCases.caseDetails?.[caseId] || null,
agentId: state?.user?.user?.referenceId || null,
caseDetails: state?.allCases?.caseDetails?.[caseId] || null,
}));
const throttledSendToWhatsapp = React.useRef(debounce(shareToWhatsapp, 500));