Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
navigateToCommitList = () => {
const { commits, locale } = this.props;
if (commits.length > 1) {
this.props.navigation.navigate('CommitList', {
title: t('Commits', locale),
commits,
locale,
});
} else {
this.props.navigation.navigate('Commit', {
commit: commits[0],
title: commits[0].sha.substring(0, 7),
});
}
};
onPress={() =>
this.props.navigation.navigate('CommitList', {
commits,
title: t('Commits', locale),
locale,
})
}
buttonAction={() => {
if (openIssues.length > 0) {
navigation.navigate('IssueList', {
title: t('Issues', locale),
searchType: 0,
query: '',
repository,
});
} else {
navigation.navigate('NewIssue', {
title: t('New Issue', locale),
repository,
});
}
}}
>
constructor(props) {
super(props);
this.state = {
code: null,
modalVisible: false,
cancelDisabled: false,
showLoader: true,
loaderText: t('Connecting to GitHub...', props.locale),
asyncStorageChecked: false,
};
}
componentWillReceiveProps(nextState) {
if (nextState.locale !== this.props.locale) {
this.setState({
updateText: updateText(nextState.locale).check,
});
const navigationParams = NavigationActions.setParams({
params: {
title: t('Options', nextState.locale),
},
key: nextState.navigation.state.key,
});
nextState.navigation.dispatch(navigationParams);
}
}