Fix regression in modular back button

This commit is contained in:
Brent Vatne
2018-02-19 14:46:25 -08:00
parent 78c2f7f55b
commit 8d386cf523
2 changed files with 6 additions and 1 deletions

View File

@@ -277,6 +277,11 @@ class Header extends React.PureComponent {
const { scene } = props;
const { index, isStale, key } = scene;
// Never render a modular back button on the first screen in a stack.
if (index === 0) {
return;
}
const offset = this.props.navigation.state.index - index;
if (Math.abs(offset) > 2) {

View File

@@ -42,7 +42,7 @@ class ModularHeaderBackButton extends React.PureComponent {
// TODO: When we've sorted out measuring in the header, let's revisit this.
// This is clearly a bad workaround.
if (backButtonTitle.length > 8) {
if (backButtonTitle && backButtonTitle.length > 8) {
backButtonTitle = truncatedTitle;
}