@hexar/biometric-identity-sdk-react-native 1.0.33 → 1.0.34

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationProgress.d.ts","sourceRoot":"","sources":["../../src/components/ValidationProgress.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAA2B,MAAM,oCAAoC,CAAC;AAE7G,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA8GhE,CAAC;AAqDF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ValidationProgress.d.ts","sourceRoot":"","sources":["../../src/components/ValidationProgress.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAA2B,MAAM,oCAAoC,CAAC;AAE7G,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAqGhE,CAAC;AAqDF,eAAe,kBAAkB,CAAC"}
@@ -45,38 +45,29 @@ const ValidationProgress = ({ progress, theme, language = 'en', }) => {
45
45
  const animatedProgress = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
46
46
  const [displayProgress, setDisplayProgress] = (0, react_1.useState)(0);
47
47
  const animationRef = (0, react_1.useRef)(null);
48
+ const hasStartedAnimation = (0, react_1.useRef)(false);
48
49
  (0, react_1.useEffect)(() => {
49
50
  if (language) {
50
51
  (0, biometric_identity_sdk_core_1.setLanguage)(language);
51
52
  }
52
53
  }, [language]);
53
54
  (0, react_1.useEffect)(() => {
54
- // Start animation from 0 to 90% over 60 seconds (1 minute)
55
- if (progress < 90) {
56
- // If we have real progress from backend, use it; otherwise animate to 90% over 60s
57
- if (progress > 0 && progress < 90) {
58
- // Use actual progress
59
- react_native_1.Animated.timing(animatedProgress, {
60
- toValue: progress,
61
- duration: 500,
62
- useNativeDriver: false,
63
- }).start();
64
- }
65
- else if (progress === 0) {
66
- // Start animation to 90% over 60 seconds
67
- if (animationRef.current) {
68
- animationRef.current.stop();
69
- }
70
- animationRef.current = react_native_1.Animated.timing(animatedProgress, {
71
- toValue: 90,
72
- duration: 60000, // 60 seconds
73
- useNativeDriver: false,
74
- });
75
- animationRef.current.start();
76
- }
55
+ // Start animation from 0 to 90% over 60 seconds (1 minute) - only once
56
+ if (!hasStartedAnimation.current) {
57
+ hasStartedAnimation.current = true;
58
+ // Start animation to 90% over 60 seconds, regardless of backend progress
59
+ animationRef.current = react_native_1.Animated.timing(animatedProgress, {
60
+ toValue: 90,
61
+ duration: 60000, // 60 seconds
62
+ useNativeDriver: false,
63
+ });
64
+ animationRef.current.start();
77
65
  }
78
- else {
79
- // If progress is 90% or more, animate to actual progress
66
+ // Only update to actual progress if it's 90% or more (validation complete)
67
+ if (progress >= 90) {
68
+ if (animationRef.current) {
69
+ animationRef.current.stop();
70
+ }
80
71
  react_native_1.Animated.timing(animatedProgress, {
81
72
  toValue: progress,
82
73
  duration: 500,
@@ -89,9 +80,6 @@ const ValidationProgress = ({ progress, theme, language = 'en', }) => {
89
80
  });
90
81
  return () => {
91
82
  animatedProgress.removeListener(listener);
92
- if (animationRef.current) {
93
- animationRef.current.stop();
94
- }
95
83
  };
96
84
  }, [progress, animatedProgress]);
97
85
  const strings = (0, biometric_identity_sdk_core_1.getStrings)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexar/biometric-identity-sdk-react-native",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "React Native wrapper for Biometric Identity SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,6 +27,7 @@ export const ValidationProgress: React.FC<ValidationProgressProps> = ({
27
27
  const animatedProgress = useRef(new Animated.Value(0)).current;
28
28
  const [displayProgress, setDisplayProgress] = useState(0);
29
29
  const animationRef = useRef<Animated.CompositeAnimation | null>(null);
30
+ const hasStartedAnimation = useRef(false);
30
31
 
31
32
  useEffect(() => {
32
33
  if (language) {
@@ -35,32 +36,25 @@ export const ValidationProgress: React.FC<ValidationProgressProps> = ({
35
36
  }, [language]);
36
37
 
37
38
  useEffect(() => {
38
- // Start animation from 0 to 90% over 60 seconds (1 minute)
39
- if (progress < 90) {
40
- // If we have real progress from backend, use it; otherwise animate to 90% over 60s
41
- if (progress > 0 && progress < 90) {
42
- // Use actual progress
43
- Animated.timing(animatedProgress, {
44
- toValue: progress,
45
- duration: 500,
46
- useNativeDriver: false,
47
- }).start();
48
- } else if (progress === 0) {
49
- // Start animation to 90% over 60 seconds
50
- if (animationRef.current) {
51
- animationRef.current.stop();
52
- }
53
-
54
- animationRef.current = Animated.timing(animatedProgress, {
55
- toValue: 90,
56
- duration: 60000, // 60 seconds
57
- useNativeDriver: false,
58
- });
59
-
60
- animationRef.current.start();
39
+ // Start animation from 0 to 90% over 60 seconds (1 minute) - only once
40
+ if (!hasStartedAnimation.current) {
41
+ hasStartedAnimation.current = true;
42
+
43
+ // Start animation to 90% over 60 seconds, regardless of backend progress
44
+ animationRef.current = Animated.timing(animatedProgress, {
45
+ toValue: 90,
46
+ duration: 60000, // 60 seconds
47
+ useNativeDriver: false,
48
+ });
49
+
50
+ animationRef.current.start();
51
+ }
52
+
53
+ // Only update to actual progress if it's 90% or more (validation complete)
54
+ if (progress >= 90) {
55
+ if (animationRef.current) {
56
+ animationRef.current.stop();
61
57
  }
62
- } else {
63
- // If progress is 90% or more, animate to actual progress
64
58
  Animated.timing(animatedProgress, {
65
59
  toValue: progress,
66
60
  duration: 500,
@@ -75,9 +69,6 @@ export const ValidationProgress: React.FC<ValidationProgressProps> = ({
75
69
 
76
70
  return () => {
77
71
  animatedProgress.removeListener(listener);
78
- if (animationRef.current) {
79
- animationRef.current.stop();
80
- }
81
72
  };
82
73
  }, [progress, animatedProgress]);
83
74