Skip to content

Commit

Permalink
bugfix/splash screen (#1857)
Browse files Browse the repository at this point in the history
* splashnavigator

* mocks
  • Loading branch information
estebanmino authored Sep 28, 2020
1 parent 4027c3e commit f575ff4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions app/__mocks__/react-native-splash-screen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
show: jest.fn().mockImplementation(() => {
console.log('show splash screen');
}),
hide: jest.fn().mockImplementation(() => {
console.log('hide splash screen');
})
};
4 changes: 1 addition & 3 deletions app/components/Views/Entry/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { colors } from '../../../styles/common';
import DeeplinkManager from '../../../core/DeeplinkManager';
import Logger from '../../../util/Logger';
import Device from '../../../util/Device';
import SplashScreen from 'react-native-splash-screen';
import { recreateVaultWithSamePassword } from '../../../core/Vault';
import { EXISTING_USER, ONBOARDING_WIZARD, METRICS_OPT_IN, ENCRYPTION_LIB, ORIGINAL } from '../../../constants/storage';

Expand Down Expand Up @@ -96,7 +95,6 @@ class Entry extends PureComponent {
async componentDidMount() {
DeeplinkManager.init(this.props.navigation);
this.unsubscribeFromBranch = Branch.subscribe(this.handleDeeplinks);
SplashScreen.hide();
const existingUser = await AsyncStorage.getItem(EXISTING_USER);
if (existingUser !== null) {
await this.unlockKeychain();
Expand Down Expand Up @@ -154,7 +152,7 @@ class Entry extends PureComponent {
NavigationActions.navigate({ routeName: 'Oboarding' })
);
} else {
this.props.navigation.navigate('HomeNav', {}, NavigationActions.navigate({ routeName: 'WalletView' }));
this.props.navigation.navigate('HomeNav');
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class Login extends PureComponent {
this.props.navigation.navigate('HomeNav');
} else {
this.props.setOnboardingWizardStep(1);
this.props.navigation.navigate('HomeNav', {}, NavigationActions.navigate({ routeName: 'WalletView' }));
this.props.navigation.navigate('HomeNav');
}
this.setState({ loading: false });
} catch (e) {
Expand Down
2 changes: 2 additions & 0 deletions app/components/Views/Root/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/lib/integration/react';

import { store, persistor } from '../../../store/';
import SplashScreen from 'react-native-splash-screen';

import App from '../../Nav/App';
import SecureKeychain from '../../../core/SecureKeychain';
Expand All @@ -18,6 +19,7 @@ export default class Root extends PureComponent {
SecureKeychain.init(props.foxCode); // eslint-disable-line
// Init EntryScriptWeb3 asynchronously on the background
EntryScriptWeb3.init();
SplashScreen.hide();
}

render = () => (
Expand Down

0 comments on commit f575ff4

Please sign in to comment.