@trustchex/react-native-sdk 1.175.5 → 1.178.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,13 +32,11 @@ const NavigationManager = /*#__PURE__*/forwardRef(({
32
32
  };
33
33
  React.useEffect(() => {
34
34
  const handleFocus = () => {
35
- // Reset navigation state when screen comes into focus
36
35
  isNavigating = false;
37
36
  };
38
37
  navigation.addListener('focus', handleFocus);
39
38
  return () => {
40
39
  navigation.removeListener('focus', handleFocus);
41
- // Reset state on cleanup
42
40
  isNavigating = false;
43
41
  };
44
42
  }, [navigation]);
@@ -66,14 +64,10 @@ const NavigationManager = /*#__PURE__*/forwardRef(({
66
64
  }, [appContext, routes.VERIFICATION_SESSION_CHECK, routes.DYNAMIC_ROUTES.CONTRACT_ACCEPTANCE, routes.DYNAMIC_ROUTES.IDENTITY_DOCUMENT_EID_SCAN, routes.DYNAMIC_ROUTES.IDENTITY_DOCUMENT_SCAN, routes.DYNAMIC_ROUTES.LIVENESS_CHECK, routes.RESULT]);
67
65
  const goToNextRoute = useCallback(() => {
68
66
  const currentTime = Date.now();
69
- const minTimeBetweenNavigation = 1000; // 1 second minimum between navigations
70
-
71
- // Simple protection: prevent rapid consecutive calls
67
+ const minTimeBetweenNavigation = 1000;
72
68
  if (isNavigating || currentTime - lastNavigationTime < minTimeBetweenNavigation) {
73
69
  return;
74
70
  }
75
-
76
- // Set protection flags
77
71
  isNavigating = true;
78
72
  lastNavigationTime = currentTime;
79
73
  try {
@@ -85,18 +79,14 @@ const NavigationManager = /*#__PURE__*/forwardRef(({
85
79
  }
86
80
  }));
87
81
  } catch (error) {
88
- // Reset flags on error
89
82
  isNavigating = false;
90
83
  throw error;
91
84
  }
92
-
93
- // Reset flags after navigation
94
85
  setTimeout(() => {
95
86
  isNavigating = false;
96
87
  }, 1000);
97
88
  }, [getNextRoute, appContext.workflowSteps, appContext.currentWorkflowStep, navigation]);
98
89
  const goToNextRouteWithAlert = useCallback(() => {
99
- // Prevent multiple alerts if already navigating
100
90
  if (isNavigating) {
101
91
  return;
102
92
  }
@@ -109,7 +99,6 @@ const NavigationManager = /*#__PURE__*/forwardRef(({
109
99
  }]);
110
100
  }, [goToNextRoute, t]);
111
101
  const reset = useCallback(() => {
112
- // Prevent rapid successive reset calls
113
102
  if (isNavigating) {
114
103
  return;
115
104
  }
@@ -117,6 +106,7 @@ const NavigationManager = /*#__PURE__*/forwardRef(({
117
106
  try {
118
107
  appContext.currentWorkflowStep = undefined;
119
108
  appContext.workflowSteps = undefined;
109
+ appContext.isDemoSession = false;
120
110
  appContext.identificationInfo = {
121
111
  sessionId: '',
122
112
  identificationId: '',
@@ -142,34 +132,16 @@ const NavigationManager = /*#__PURE__*/forwardRef(({
142
132
  isNavigating = false;
143
133
  throw error;
144
134
  }
145
-
146
- // Reset flag after operation
147
135
  setTimeout(() => {
148
136
  isNavigating = false;
149
137
  }, 1000);
150
138
  }, [appContext, navigation, routes.VERIFICATION_SESSION_CHECK]);
151
-
152
- // Use usePreventRemove instead of beforeRemove listener to prevent the warning
153
- // This prevents users from natively going back multiple screens
154
139
  usePreventRemove(true, ({
155
140
  data
156
141
  }) => {
157
- // Only allow RESET actions to proceed
158
142
  if (data.action.type === 'RESET') {
159
- return;
143
+ navigation.dispatch(data.action);
160
144
  }
161
-
162
- // Show confirmation dialog for other navigation attempts
163
- Alert.alert(t('general.warning'), t('navigationManager.preventBackWarning'), [{
164
- text: t('general.cancel'),
165
- style: 'cancel'
166
- }, {
167
- text: t('general.yes'),
168
- onPress: () => {
169
- // Allow the navigation by calling reset
170
- reset();
171
- }
172
- }]);
173
145
  });
174
146
  useImperativeHandle(ref, () => ({
175
147
  navigateToNextStep: goToNextRoute,
@@ -105,6 +105,5 @@ export default {
105
105
  'identityDocumentCamera.scanCompleted': 'Scan completed successfully.',
106
106
  'navigationManager.skipStepWarning': 'It is recommended to complete this step. Are you sure you want to skip it?',
107
107
  'navigationManager.skipStepLabel': 'Skip this step',
108
- 'navigationManager.preventBackWarning': 'Are you sure you want to leave? Your progress may be lost.',
109
108
  'qrCodeScanningScreen.title': 'Scan QR Code'
110
109
  };
@@ -108,6 +108,5 @@ export default {
108
108
  'identityDocumentCamera.scanCompleted': 'Tarama başarıyla tamamlandı.',
109
109
  'navigationManager.skipStepWarning': 'Bu adımı tamamlamanız tavsiye edilir. Adımı atlamak istediğinize emin misiniz?',
110
110
  'navigationManager.skipStepLabel': 'Bu adımı atla',
111
- 'navigationManager.preventBackWarning': 'Ayrılmak istediğinize emin misiniz? İlerlemeniz kaybolabilir.',
112
111
  'qrCodeScanningScreen.title': 'QR Kodu Tara'
113
112
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationManager.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/NavigationManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAiBf,MAAM,MAAM,oBAAoB,GAAG;IACjC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,iBAAiB,wFAmPtB,CAAC;AAWF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"NavigationManager.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/NavigationManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAiBf,MAAM,MAAM,oBAAoB,GAAG;IACjC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,iBAAiB,wFAqNtB,CAAC;AAWF,eAAe,iBAAiB,CAAC"}
@@ -103,7 +103,6 @@ declare const _default: {
103
103
  'identityDocumentCamera.scanCompleted': string;
104
104
  'navigationManager.skipStepWarning': string;
105
105
  'navigationManager.skipStepLabel': string;
106
- 'navigationManager.preventBackWarning': string;
107
106
  'qrCodeScanningScreen.title': string;
108
107
  };
109
108
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/en.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAwJE"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/en.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAsJE"}
@@ -106,7 +106,6 @@ declare const _default: {
106
106
  'identityDocumentCamera.scanCompleted': string;
107
107
  'navigationManager.skipStepWarning': string;
108
108
  'navigationManager.skipStepLabel': string;
109
- 'navigationManager.preventBackWarning': string;
110
109
  'qrCodeScanningScreen.title': string;
111
110
  };
112
111
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/tr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAyJE"}
1
+ {"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/tr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAuJE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustchex/react-native-sdk",
3
- "version": "1.175.5",
3
+ "version": "1.178.0",
4
4
  "description": "Trustchex mobile app react native SDK for android or ios devices",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -48,7 +48,6 @@ const NavigationManager = forwardRef(
48
48
 
49
49
  React.useEffect(() => {
50
50
  const handleFocus = () => {
51
- // Reset navigation state when screen comes into focus
52
51
  isNavigating = false;
53
52
  };
54
53
 
@@ -56,7 +55,6 @@ const NavigationManager = forwardRef(
56
55
 
57
56
  return () => {
58
57
  navigation.removeListener('focus', handleFocus);
59
- // Reset state on cleanup
60
58
  isNavigating = false;
61
59
  };
62
60
  }, [navigation]);
@@ -116,9 +114,8 @@ const NavigationManager = forwardRef(
116
114
 
117
115
  const goToNextRoute = useCallback(() => {
118
116
  const currentTime = Date.now();
119
- const minTimeBetweenNavigation = 1000; // 1 second minimum between navigations
117
+ const minTimeBetweenNavigation = 1000;
120
118
 
121
- // Simple protection: prevent rapid consecutive calls
122
119
  if (
123
120
  isNavigating ||
124
121
  currentTime - lastNavigationTime < minTimeBetweenNavigation
@@ -126,7 +123,6 @@ const NavigationManager = forwardRef(
126
123
  return;
127
124
  }
128
125
 
129
- // Set protection flags
130
126
  isNavigating = true;
131
127
  lastNavigationTime = currentTime;
132
128
 
@@ -145,12 +141,10 @@ const NavigationManager = forwardRef(
145
141
  })
146
142
  );
147
143
  } catch (error) {
148
- // Reset flags on error
149
144
  isNavigating = false;
150
145
  throw error;
151
146
  }
152
147
 
153
- // Reset flags after navigation
154
148
  setTimeout(() => {
155
149
  isNavigating = false;
156
150
  }, 1000);
@@ -162,7 +156,6 @@ const NavigationManager = forwardRef(
162
156
  ]);
163
157
 
164
158
  const goToNextRouteWithAlert = useCallback(() => {
165
- // Prevent multiple alerts if already navigating
166
159
  if (isNavigating) {
167
160
  return;
168
161
  }
@@ -184,7 +177,6 @@ const NavigationManager = forwardRef(
184
177
  }, [goToNextRoute, t]);
185
178
 
186
179
  const reset = useCallback(() => {
187
- // Prevent rapid successive reset calls
188
180
  if (isNavigating) {
189
181
  return;
190
182
  }
@@ -194,6 +186,7 @@ const NavigationManager = forwardRef(
194
186
  try {
195
187
  appContext.currentWorkflowStep = undefined;
196
188
  appContext.workflowSteps = undefined;
189
+ appContext.isDemoSession = false;
197
190
  appContext.identificationInfo = {
198
191
  sessionId: '',
199
192
  identificationId: '',
@@ -221,38 +214,15 @@ const NavigationManager = forwardRef(
221
214
  throw error;
222
215
  }
223
216
 
224
- // Reset flag after operation
225
217
  setTimeout(() => {
226
218
  isNavigating = false;
227
219
  }, 1000);
228
220
  }, [appContext, navigation, routes.VERIFICATION_SESSION_CHECK]);
229
221
 
230
- // Use usePreventRemove instead of beforeRemove listener to prevent the warning
231
- // This prevents users from natively going back multiple screens
232
222
  usePreventRemove(true, ({ data }) => {
233
- // Only allow RESET actions to proceed
234
223
  if (data.action.type === 'RESET') {
235
- return;
224
+ navigation.dispatch(data.action);
236
225
  }
237
-
238
- // Show confirmation dialog for other navigation attempts
239
- Alert.alert(
240
- t('general.warning'),
241
- t('navigationManager.preventBackWarning'),
242
- [
243
- {
244
- text: t('general.cancel'),
245
- style: 'cancel',
246
- },
247
- {
248
- text: t('general.yes'),
249
- onPress: () => {
250
- // Allow the navigation by calling reset
251
- reset();
252
- },
253
- },
254
- ]
255
- );
256
226
  });
257
227
 
258
228
  useImperativeHandle(ref, () => ({
@@ -147,7 +147,5 @@ export default {
147
147
  'navigationManager.skipStepWarning':
148
148
  'It is recommended to complete this step. Are you sure you want to skip it?',
149
149
  'navigationManager.skipStepLabel': 'Skip this step',
150
- 'navigationManager.preventBackWarning':
151
- 'Are you sure you want to leave? Your progress may be lost.',
152
150
  'qrCodeScanningScreen.title': 'Scan QR Code',
153
151
  };
@@ -148,7 +148,5 @@ export default {
148
148
  'navigationManager.skipStepWarning':
149
149
  'Bu adımı tamamlamanız tavsiye edilir. Adımı atlamak istediğinize emin misiniz?',
150
150
  'navigationManager.skipStepLabel': 'Bu adımı atla',
151
- 'navigationManager.preventBackWarning':
152
- 'Ayrılmak istediğinize emin misiniz? İlerlemeniz kaybolabilir.',
153
151
  'qrCodeScanningScreen.title': 'QR Kodu Tara',
154
152
  };