BlueWallet/index.js
Marcos Rodriguez 29ce0271f8 ADD: Biometrics
FIX: Added FaceID Usage description

ADD: Use Biometrics for Show balance.

ADD: Unlock With Boot Screen

FIX: Allow the use of Biometrics after decrypt

FIX: Build system revert.

FIX: Remove biometric from receive address.

ADD: Biometric for export

FIX: Use RNSecureKeyStore for biometrics

FIX: Realign views

Update biometrics.js
2019-09-27 20:12:25 -04:00

82 lines
2.3 KiB
JavaScript

import 'intl';
import 'intl/locale-data/jsonp/en';
import React from 'react';
import './shim.js';
import { Sentry } from 'react-native-sentry';
import { AppRegistry } from 'react-native';
import WalletMigrate from './screen/wallets/walletMigrate';
import { name as appName } from './app.json';
import App from './App';
import LottieView from 'lottie-react-native';
import UnlockWith from './UnlockWith.js';
/** @type {AppStorage} */
let A = require('./analytics');
if (process.env.NODE_ENV !== 'development') {
Sentry.config('https://23377936131848ca8003448a893cb622@sentry.io/1295736').install();
}
if (!Error.captureStackTrace) {
// captureStackTrace is only available when debugging
Error.captureStackTrace = () => {};
}
class BlueAppComponent extends React.Component {
constructor(props) {
super(props);
this.state = { isMigratingData: true, onAnimationFinished: false, successfullyAuthenticated: false };
}
componentDidMount() {
const walletMigrate = new WalletMigrate(this.setIsMigratingData);
walletMigrate.start();
}
setIsMigratingData = async () => {
A(A.ENUM.INIT);
this.setState({ isMigratingData: false });
};
onAnimationFinish = () => {
if (this.state.isMigratingData) {
this.loadingSplash.play(0);
} else {
this.setState({ onAnimationFinished: true });
}
};
onSuccessfullyAuthenticated = () => {
this.setState({ successfullyAuthenticated: true })
}
render() {
if (this.state.isMigratingData) {
return (
<LottieView
ref={ref => (this.loadingSplash = ref)}
onAnimationFinish={this.onAnimationFinish}
source={require('./img/bluewalletsplash.json')}
autoPlay
loop={false}
/>
);
} else {
if (this.state.onAnimationFinished) {
return this.state.successfullyAuthenticated ? <App /> : <UnlockWith onSuccessfullyAuthenticated={this.onSuccessfullyAuthenticated} />;
} else {
return (
<LottieView
ref={ref => (this.loadingSplash = ref)}
onAnimationFinish={this.onAnimationFinish}
source={require('./img/bluewalletsplash.json')}
autoPlay
loop={false}
/>
);
}
}
}
}
AppRegistry.registerComponent(appName, () => BlueAppComponent);