Update LoadingScreen.js

This commit is contained in:
marcosrdz 2020-06-20 10:06:36 -04:00 committed by Overtorment
parent 46746bf8b3
commit 9a367585a9

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState, useRef } from 'react';
import React, { useState, useRef } from 'react';
import LottieView from 'lottie-react-native';
import WalletMigrate from './screen/wallets/walletMigrate';
import * as NavigationService from './NavigationService';
@ -11,7 +11,7 @@ const LoadingScreen = () => {
const handleMigrationComplete = async () => {
setIsMigratinData(false);
};
const walletMigrate = new WalletMigrate(handleMigrationComplete);
const walletMigrate = useRef(new WalletMigrate(handleMigrationComplete));
const replaceStackNavigation = () => {
NavigationService.dispatch(StackActions.replace('UnlockWithScreenRoot'));
@ -25,9 +25,7 @@ const LoadingScreen = () => {
}
};
useEffect(() => {
walletMigrate.start();
}, [walletMigrate]);
walletMigrate.current.start();
return (
<LottieView
ref={loadingAnimation}