TP-31863 | fixes
This commit is contained in:
@@ -26,6 +26,7 @@ import { loggedOutCurrentUser } from '../hooks/useFirestoreUpdates';
|
||||
import { GenericFunctionArgs, GenericType } from '../common/GenericTypes';
|
||||
import { GoogleSignin } from '@react-native-google-signin/google-signin';
|
||||
import { resetConfig } from '../reducer/configSlice';
|
||||
import { resetProfileData } from '../reducer/profileSlice';
|
||||
|
||||
export interface GenerateOTPPayload {
|
||||
phoneNumber: string;
|
||||
@@ -198,6 +199,7 @@ export const handleLogout = () => async (dispatch: AppDispatch) => {
|
||||
);
|
||||
dispatch(resetCasesData());
|
||||
dispatch(resetConfig());
|
||||
dispatch(resetProfileData());
|
||||
} catch (err) {
|
||||
logError(err as Error, 'Logout clear session details error');
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export const getSelfieDocument = () => (dispatch: AppDispatch) => {
|
||||
.get(url)
|
||||
.then((res) => {
|
||||
if (res.data?.documents?.[0]?.originalDocumentUri) {
|
||||
const { documents, agencyName } = res.data;
|
||||
const { documents, agencyName, agencyCode } = res.data;
|
||||
const { originalDocumentUri, updatedAt, approvalStatus } = documents[0];
|
||||
dispatch(
|
||||
setOriginalImageDetails({
|
||||
@@ -48,6 +48,7 @@ export const getSelfieDocument = () => (dispatch: AppDispatch) => {
|
||||
validationDate: updatedAt,
|
||||
approvalStatus,
|
||||
agencyName,
|
||||
agencyCode,
|
||||
})
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -617,3 +617,5 @@ export const REQUEST_TO_UNBLOCK_FOR_IMPERSONATION = [
|
||||
getApiUrl(ApiKeys.GET_SIGNED_URL),
|
||||
getApiUrl(ApiKeys.LOGOUT),
|
||||
];
|
||||
|
||||
export const NAVI_AGENCY_CODE = 1000;
|
||||
|
||||
@@ -15,6 +15,7 @@ const initialState = {
|
||||
showReviewImageModal: false,
|
||||
approvalStatus: ImageApprovalStatus.NOT_INITIATED,
|
||||
agencyName: '',
|
||||
agencyCode: -1,
|
||||
};
|
||||
|
||||
export const profileSlice = createSlice({
|
||||
@@ -25,11 +26,13 @@ export const profileSlice = createSlice({
|
||||
state.imageUri = action.payload;
|
||||
},
|
||||
setOriginalImageDetails: (state, action) => {
|
||||
const { originalImageUri, validationDate, approvalStatus, agencyName } = action.payload;
|
||||
const { originalImageUri, validationDate, approvalStatus, agencyName, agencyCode } =
|
||||
action.payload;
|
||||
state.originalImageUri = originalImageUri;
|
||||
state.validationDate = validationDate;
|
||||
state.approvalStatus = approvalStatus;
|
||||
state.agencyName = agencyName;
|
||||
state.agencyCode = agencyCode;
|
||||
},
|
||||
setIsUploadingImage: (state, action) => {
|
||||
state.isUploadingImage = action.payload;
|
||||
@@ -44,6 +47,7 @@ export const profileSlice = createSlice({
|
||||
setApprovalStatus: (state, action) => {
|
||||
state.approvalStatus = action.payload;
|
||||
},
|
||||
resetProfileData: () => initialState,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -53,6 +57,7 @@ export const {
|
||||
setShowReviewImageModal,
|
||||
setOriginalImageDetails,
|
||||
setApprovalStatus,
|
||||
resetProfileData,
|
||||
} = profileSlice.actions;
|
||||
|
||||
export default profileSlice.reducer;
|
||||
|
||||
@@ -8,22 +8,23 @@ import Heading from '../../../RN-UI-LIB/src/components/Heading';
|
||||
import { COLORS } from '../../../RN-UI-LIB/src/styles/colors';
|
||||
import { useAppSelector } from '../../hooks';
|
||||
import { BUSINESS_DATE_FORMAT, dateFormat } from '../../../RN-UI-LIB/src/utlis/dates';
|
||||
import { NAVI_AGENCY_CODE } from '../../common/Constants';
|
||||
|
||||
const AgentIdCard = () => {
|
||||
const { originalImageUri, agentName, agentPhone, validationDate, agencyName } = useAppSelector(
|
||||
(state) => ({
|
||||
const { originalImageUri, agentName, agentPhone, validationDate, agencyName, agencyCode } =
|
||||
useAppSelector((state) => ({
|
||||
originalImageUri: state.profile.originalImageUri,
|
||||
agentName: state.user.user?.name!!,
|
||||
agentPhone: state.user.user?.phoneNumber,
|
||||
validationDate: state.profile.validationDate,
|
||||
agencyName: state.profile.agencyName,
|
||||
})
|
||||
);
|
||||
agencyCode: state.profile.agencyCode,
|
||||
}));
|
||||
|
||||
return (
|
||||
<View style={[GenericStyles.p24, GenericStyles.alignCenter, { width: SCREEN_WIDTH - 32 }]}>
|
||||
<NaviLogoWithTextIcon />
|
||||
{agencyName ? (
|
||||
{agencyName && agencyCode !== NAVI_AGENCY_CODE ? (
|
||||
<View>
|
||||
<Text small bold style={styles.greyColor}>
|
||||
in association with
|
||||
|
||||
Reference in New Issue
Block a user