-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
40 lines (33 loc) · 1.19 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React, { useEffect, useState } from 'react';
import './shim.js';
import { AppRegistry } from 'react-native';
import App from './App';
import { BlueStorageProvider } from './blue_modules/storage-context';
import SplashScreen from 'react-native-splash-screen';
import { getIntroSliderFlage, setFlage } from './store/asyncStorage.js';
import { WasmWebView } from './components/wasm_webview/WasmWebView';
const A = require('./blue_modules/analytics');
if (!Error.captureStackTrace) {
// captureStackTrace is only available when debugging
Error.captureStackTrace = () => {};
}
const BlueAppComponent = () => {
const [wasmInitializationFinished, setWasmInitializationFinished] = useState(false);
useEffect(() => {
A(A.ENUM.INIT);
setTimeout(() => {
SplashScreen.hide();
}, 5000);
getIntroSliderFlage(cbSuccess);
}, []);
function cbSuccess(val) {
setFlage(val === null ? false : Boolean(val));
}
return (
<BlueStorageProvider>
{wasmInitializationFinished && <App />}
<WasmWebView setWasmInitializationFinished={setWasmInitializationFinished} />
</BlueStorageProvider>
);
};
AppRegistry.registerComponent('BlueWallet', () => BlueAppComponent);