diff --git a/android/app/build.gradle b/android/app/build.gradle index 122826ba..86eb5c51 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -134,8 +134,8 @@ def reactNativeArchitectures() { return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } -def VERSION_CODE = 209 -def VERSION_NAME = "2.14.9" +def VERSION_CODE = 211 +def VERSION_NAME = "2.14.11" android { ndkVersion rootProject.ext.ndkVersion diff --git a/package.json b/package.json index 095b5ee2..6972bfe1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "AV_APP", - "version": "2.14.9", - "buildNumber": "209", + "version": "2.14.11", + "buildNumber": "211", "private": true, "scripts": { "android:dev": "yarn move:dev && react-native run-android", diff --git a/src/screens/allCases/utils.ts b/src/screens/allCases/utils.ts index 3e5c4ca3..fc1070e6 100644 --- a/src/screens/allCases/utils.ts +++ b/src/screens/allCases/utils.ts @@ -1,6 +1,6 @@ import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants'; import { getDistanceFromLatLonInKm, isFunction } from '@components/utlis/commonFunctions'; -import { IGeoLocation } from '@interfaces/addressGeolocation.types'; +import { IGeoLocation, IGeolocationCoordinate } from '@interfaces/addressGeolocation.types'; import { addClickstreamEvent } from '@services/clickstreamEventService'; import { Address, @@ -88,13 +88,9 @@ export const sectionListTranformData = (agentList: IReportee[]): ISectionListDat return result; }; -export const getAddressLocation = (addresses: Address[] | undefined) => { - if (!addresses?.length) return null; - - for (const address of addresses) { - if (address?.location?.latitude && address?.location?.longitude) { - return address.location; - } +export const getAddressLocation = (address?: IGeolocationCoordinate) => { + if(address?.latitude && address?.longitude) { + return address; } return null; }; @@ -108,7 +104,7 @@ export const getNearByCases = ( let caseIds: Array = []; casesList?.forEach((pinnedId) => { const caseDetail = caseDetails?.[pinnedId.caseReferenceId]; - const addressLocation = getAddressLocation(caseDetail?.addresses); + const addressLocation = getAddressLocation(caseDetail?.addressLocation); if (addressLocation) { const distanceInKm = getDistanceFromLatLonInKm(addressLocation, deviceGeolocationCoordinate); @@ -194,7 +190,7 @@ export const updateNearbyCasesListAndLocation = ( let caseIdsToDistancesFromCurrentLocationMap: Map = new Map(); allCasesList?.forEach((pinnedId) => { const caseDetail = caseDetails?.[pinnedId?.caseReferenceId] || {}; - const addressLocation = getAddressLocation(caseDetail?.addresses); + const addressLocation = getAddressLocation(caseDetail?.addressLocation); if (addressLocation) { const distanceInKm = getDistanceFromLatLonInKm( addressLocation, diff --git a/src/screens/caseDetails/interface.ts b/src/screens/caseDetails/interface.ts index b88ddff5..595a4d7f 100644 --- a/src/screens/caseDetails/interface.ts +++ b/src/screens/caseDetails/interface.ts @@ -286,6 +286,7 @@ export interface CaseDetail { dpdBucket: string; dpdCycle: string; addresses?: Address[]; + addressLocation?: IGeolocationCoordinate; currentAllocationReferenceId: string; customerReferenceId: string; caseViewCreatedAt?: number;