Merge pull request #636 from navi-medici/hotfix_3Nov

TP-00000 | HotFix For App Crashes - Chunking Removed
This commit is contained in:
Varnit Goyal
2023-11-06 17:24:02 +05:30
committed by GitHub
5 changed files with 20 additions and 28 deletions

View File

@@ -133,8 +133,8 @@ def reactNativeArchitectures() {
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}
def VERSION_CODE = 98
def VERSION_NAME = "2.5.3"
def VERSION_CODE = 99
def VERSION_NAME = "2.5.4"
android {
ndkVersion rootProject.ext.ndkVersion

View File

@@ -1,6 +1,6 @@
{
"name": "AV_APP",
"version": "2.5.3",
"version": "2.5.4",
"private": true,
"scripts": {
"android:dev": "yarn move:dev && react-native run-android",

View File

@@ -106,7 +106,7 @@ export class CaptureGeolocation {
logError(error as any, 'Unable to get location');
reject(error);
},
{ enableHighAccuracy: true, distanceFilter: 10, forceRequestLocation: true }
{ enableHighAccuracy: true, distanceFilter: 50, forceRequestLocation: true }
);
});
}

View File

@@ -4,7 +4,6 @@ import auth from '@react-native-firebase/auth';
import { setFeedbackFilterTemplate } from '@reducers/feedbackFiltersSlice';
import perf from '@react-native-firebase/perf';
import { InteractionManager } from 'react-native';
import chunks from 'lodash.chunk';
import { type RootState } from '../store/store';
import { useAppDispatch, useAppSelector } from '.';
import { setLoading, updateCaseDetailsFirestore } from '../reducer/allCasesSlice';
@@ -20,9 +19,6 @@ import { setForceUninstallData } from '../reducer/metadataSlice';
import { logError } from '../components/utlis/errorUtils';
import { type GenericFunctionArgs } from '../common/GenericTypes';
const CASE_BATCH_SIZE = 5;
export interface CaseUpdates {
updateType: string;
updatedCaseDetail: CaseDetail;
@@ -112,23 +108,18 @@ const useFirestoreUpdates = () => {
});
const isInitialLoad = casesList.length === 0;
await trace.stop();
const casesChunks = chunks(caseUpdates, CASE_BATCH_SIZE);
casesChunks.forEach((chunk) => {
InteractionManager.runAfterInteractions(() => {
requestAnimationFrame(()=>{
InteractionManager.runAfterInteractions(() => {
dispatch(
updateCaseDetailsFirestore({
caseUpdates: chunk,
isInitialLoad,
isVisitPlanLocked: lockRef?.current?.visitPlanStatus === VisitPlanStatus.LOCKED,
selectedAgent
})
);
});
})
InteractionManager.runAfterInteractions(() => {
requestAnimationFrame(() => {
InteractionManager.runAfterInteractions(() => {
dispatch(
updateCaseDetailsFirestore({
caseUpdates,
isInitialLoad,
isVisitPlanLocked: lockRef?.current?.visitPlanStatus === VisitPlanStatus.LOCKED,
selectedAgent,
})
);
});
});
});
!isInitialLoad && showCaseUpdationToast(newlyAddedCases, deletedCases);
@@ -173,7 +164,7 @@ const useFirestoreUpdates = () => {
snapshot: FirebaseFirestoreTypes.DocumentSnapshot<FirebaseFirestoreTypes.DocumentData>
) => {
const lockData = snapshot.data();
lockData && dispatch(setLockData(lockData));
lockData && dispatch(setLockData(lockData));
};
const handleFeedbackFilters = (

View File

@@ -164,9 +164,10 @@ const FeedbackDetailItem = ({
</TouchableOpacity>
) : null}
<TouchableOpacity
hitSlop={{ top: 10, bottom: 10, left: 0, right: 10 }}
hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }}
activeOpacity={0.7}
onPress={() => {
onPress={(e) => {
e.stopPropagation();
throttledSendToWhatsapp.current(
feedbackItem,
caseDetails,