Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Engine.context.PersonalMessageManager.hub.on('unapprovedMessage', messageParams => {
if (!this.isTabActive()) return false;
this.setState({ signMessage: true, signMessageParams: messageParams, signType: 'personal' });
});
Engine.context.TypedMessageManager.hub.on('unapprovedMessage', messageParams => {
if (!this.isTabActive()) return false;
this.setState({ signMessage: true, signMessageParams: messageParams, signType: 'typed' });
});
Engine.context.AssetsController.hub.on('pendingSuggestedAsset', suggestedAssetMeta => {
if (!this.isTabActive()) return false;
this.setState({ watchAsset: true, suggestedAssetMeta });
});
Branch.subscribe(this.handleDeeplinks);
if (Platform.OS === 'ios') {
this.state.scrollAnim.addListener(({ value }) => {
const diff = value - this.scrollValue;
this.scrollValue = value;
this.clampedScrollValue = Math.min(Math.max(this.clampedScrollValue + diff, 0), BOTTOM_NAVBAR_HEIGHT);
});
this.state.offsetAnim.addListener(({ value }) => {
this.offsetValue = value;
});
} else {
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this.keyboardDidHide);
}
// Listen to network changes
componentDidMount() {
DeeplinkManager.init(this.props.navigation);
this.unsubscribeFromBranch = Branch.subscribe(this.handleDeeplinks);
setTimeout(async () => {
const existingUser = await AsyncStorage.getItem('@MetaMask:existingUser');
if (existingUser !== null) {
await this.unlockKeychain();
} else {
this.animateAndGoTo('OnboardingRootNav');
}
}, 100);
}
componentDidMount() {
branch.subscribe(this.onDeepLinkData)
}