@applicaster/zapp-react-native-ui-components 15.1.5-alpha.2103044873 → 15.1.5-alpha.2532506301

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.
@@ -61,34 +61,46 @@ export const GeneralContentScreen = ({
61
61
 
62
62
  const useRiverActionProviderReady = () => {
63
63
  const actionsInitialStateSetters = useRiverInitialState();
64
+ const waitStartedRef = React.useRef(false);
64
65
 
65
66
  const [riverActionProvidersReady, setRiverActionProvidersReady] =
66
- React.useState(actionsInitialStateSetters.length === 0);
67
+ React.useState(
68
+ Array.isArray(actionsInitialStateSetters) &&
69
+ actionsInitialStateSetters.length === 0
70
+ );
67
71
 
68
72
  useEffect(() => {
69
- if (!riverActionProvidersReady) {
70
- if (actionsInitialStateSetters.length > 0) {
71
- allSettled(actionsInitialStateSetters).finally(() => {
72
- log_debug(
73
- "ScreenContainer: action provider ready, completed. Starting to present screen"
74
- );
75
-
76
- setRiverActionProvidersReady(true);
77
- });
78
- } else {
79
- log_debug(
80
- "ScreenContainer: no action provider to check, completed. Starting to present screen"
81
- );
82
-
83
- setRiverActionProvidersReady(true);
84
- }
73
+ if (riverActionProvidersReady || waitStartedRef.current) {
74
+ return;
85
75
  }
76
+
77
+ // Still waiting to capture river-init promises
78
+ if (actionsInitialStateSetters === undefined) {
79
+ return;
80
+ }
81
+
82
+ if (actionsInitialStateSetters.length === 0) {
83
+ log_debug(
84
+ "ScreenContainer: no action provider to check, completed. Starting to present screen"
85
+ );
86
+
87
+ setRiverActionProvidersReady(true);
88
+
89
+ return;
90
+ }
91
+
92
+ waitStartedRef.current = true;
93
+
94
+ allSettled(actionsInitialStateSetters).finally(() => {
95
+ log_debug(
96
+ "ScreenContainer: action provider ready, completed. Starting to present screen"
97
+ );
98
+
99
+ setRiverActionProvidersReady(true);
100
+ });
86
101
  }, [actionsInitialStateSetters, riverActionProvidersReady]);
87
102
 
88
- return React.useMemo(
89
- () => riverActionProvidersReady,
90
- [riverActionProvidersReady]
91
- );
103
+ return riverActionProvidersReady;
92
104
  };
93
105
 
94
106
  React.useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "15.1.5-alpha.2103044873",
3
+ "version": "15.1.5-alpha.2532506301",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "15.1.5-alpha.2103044873",
32
- "@applicaster/zapp-react-native-bridge": "15.1.5-alpha.2103044873",
33
- "@applicaster/zapp-react-native-redux": "15.1.5-alpha.2103044873",
34
- "@applicaster/zapp-react-native-utils": "15.1.5-alpha.2103044873",
31
+ "@applicaster/applicaster-types": "15.1.5-alpha.2532506301",
32
+ "@applicaster/zapp-react-native-bridge": "15.1.5-alpha.2532506301",
33
+ "@applicaster/zapp-react-native-redux": "15.1.5-alpha.2532506301",
34
+ "@applicaster/zapp-react-native-utils": "15.1.5-alpha.2532506301",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "url": "^0.11.0",