2018-12-24 19:12:27 +01:00
|
|
|
import 'intl';
|
|
|
|
import 'intl/locale-data/jsonp/en';
|
2018-12-11 23:52:46 +01:00
|
|
|
import React from 'react';
|
|
|
|
import './shim.js';
|
2018-12-12 14:29:10 +01:00
|
|
|
import App from './App';
|
2018-12-11 23:52:46 +01:00
|
|
|
import { AppRegistry } from 'react-native';
|
|
|
|
import WalletMigrate from './screen/wallets/walletMigrate';
|
|
|
|
import { name as appName } from './app.json';
|
|
|
|
/** @type {AppStorage} */
|
|
|
|
const BlueApp = require('./BlueApp');
|
|
|
|
|
|
|
|
if (!Error.captureStackTrace) {
|
|
|
|
// captureStackTrace is only available when debugging
|
|
|
|
Error.captureStackTrace = () => {};
|
|
|
|
}
|
|
|
|
|
|
|
|
class BlueAppComponent extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.state = { isMigratingData: true };
|
|
|
|
}
|
|
|
|
|
|
|
|
async setIsMigratingData() {
|
|
|
|
await BlueApp.startAndDecrypt();
|
|
|
|
this.setState({ isMigratingData: false });
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2018-12-12 14:29:10 +01:00
|
|
|
return this.state.isMigratingData ? <WalletMigrate onComplete={() => this.setIsMigratingData()} /> : <App />;
|
2018-12-11 23:52:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AppRegistry.registerComponent(appName, () => BlueAppComponent);
|