@momo-kits/foundation 0.112.1-beta.6 → 0.112.1-beta.8

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.
Files changed (2) hide show
  1. package/index.ts +22 -18
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -7,25 +7,29 @@ import LinearGradient from 'react-native-linear-gradient';
7
7
  import {Configs} from './Consts';
8
8
 
9
9
  if (typeof (global as any)?.miniAppApi?.dispatch === 'function') {
10
- (global as any)?.miniAppApi?.dispatch?.(
11
- 'getFeatureById',
12
- 'platform_config',
13
- (res: any) => {
14
- const config = JSON.parse(res?.param);
15
- const designSystemUrl = config?.design_system;
16
- if (designSystemUrl) {
17
- fetch(designSystemUrl)
18
- .then(res => res.json())
19
- .then(data => {
20
- if (data) {
21
- Configs.headerBar = data?.headerBar;
22
- Configs.headerGradient = data?.headerGradient;
23
- Configs.trustBanner = data?.trustBanner;
24
- }
25
- });
10
+ try {
11
+ (global as any)?.miniAppApi?.dispatch?.(
12
+ 'getFeatureById',
13
+ 'platform_config',
14
+ (res: any) => {
15
+ const config = JSON.parse(res?.param);
16
+ const designSystemUrl = config?.design_system;
17
+ if (designSystemUrl) {
18
+ fetch(designSystemUrl)
19
+ .then(res => res.json())
20
+ .then(data => {
21
+ if (data) {
22
+ Configs.headerBar = data?.headerBar;
23
+ Configs.headerGradient = data?.headerGradient;
24
+ Configs.trustBanner = data?.trustBanner;
25
+ }
26
+ });
27
+ }
26
28
  }
27
- }
28
- );
29
+ );
30
+ } catch (e) {
31
+ console.log('Error fetching design system config', e);
32
+ }
29
33
  }
30
34
 
31
35
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.112.1-beta.6",
3
+ "version": "0.112.1-beta.8",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},