@fto-consult/expo-ui 8.20.0 → 8.20.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.20.0",
3
+ "version": "8.20.3",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -69,7 +69,7 @@
69
69
  "dependencies": {
70
70
  "@emotion/react": "^11.11.1",
71
71
  "@faker-js/faker": "^8.0.2",
72
- "@fto-consult/common": "^4.20.0",
72
+ "@fto-consult/common": "^4.20.8",
73
73
  "@fto-consult/node-utils": "^1.4.7",
74
74
  "apexcharts": "^3.45.2",
75
75
  "crypto-browserify": "^3.12.0",
package/src/App.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import session from "$session";
2
2
  import {useState,useEffect} from "$react";
3
3
  import Provider from "$econtext/Provider";
4
+ import {isMobileNative} from "$cplatform";
4
5
  import App from "./AppEntry";
5
6
  /****
6
7
  * les options sont de la forme :
@@ -15,19 +16,18 @@ import App from "./AppEntry";
15
16
  * }
16
17
  */
17
18
 
18
- export default function ExpoUIAppEntryProvider({children,init,...rest}){
19
+ export default function ExpoUIAppEntryProvider({children:cChildren,init,...rest}){
19
20
  const [children,setChildren] = useState(null);
21
+ const canInit = typeof session.init =="function";
20
22
  useEffect(()=>{
21
- const end = ()=>{
22
- setChildren(<Provider {...rest}>
23
- <App init={init} children={children}/>
23
+ if(!canInit) return ()=>{}
24
+ Promise.resolve(session.init()).finally(()=>{
25
+ return setChildren(<Provider {...rest}>
26
+ <App init={init} children={cChildren}/>
24
27
  </Provider>);
25
- };
26
- if(typeof session?.init =="function"){
27
- return Promise.resolve(init).finally(end);
28
- } else {
29
- end();
30
- }
28
+ });
31
29
  },[]);
32
- return children;
30
+ return canInit ? children : <Provider {...rest}>
31
+ <App init={init} children={cChildren}/>
32
+ </Provider>;
33
33
  }
@@ -1,6 +1,6 @@
1
1
  import * as SQLite from 'expo-sqlite/next';
2
2
  import {isDev} from "$cplatform";
3
- import appConfig from "$capp/config";
3
+ import {getName} from "$capp/config.utils";
4
4
  import {sanitizeFileName,isNonNullString,isObj,defaultObj} from "$cutils";
5
5
  import {sanitizeKey as cSanitizeKey,handleGetValue,handleSetValue} from "$csession/utils";
6
6
  import * as FileSystem from 'expo-file-system';
@@ -19,7 +19,7 @@ export class SQLiteSession {
19
19
  this.data = new Map();
20
20
  }
21
21
  getDBName(){
22
- let appName = appConfig.name;
22
+ let appName = getName();
23
23
  const suffix = "sqlite-sessname";
24
24
  if(isNonNullString(appName)){
25
25
  appName = sanitizeFileName(appName.replaceAll("\\","/").replaceAll("\\","")).replace(/\s+/g, "").trim();