修复bug: 点击底栏tab‘首页’,‘关注’加列表为空值判断

This commit is contained in:
xuwenyang 2019-07-15 22:49:56 +08:00
parent b210fa92fd
commit ad2a7d6212
2 changed files with 6 additions and 2 deletions

View file

@ -56,7 +56,9 @@ export default class FollowPage extends Component {
this.bottomTabEventListener = Navigation.events().registerBottomTabSelectedListener( this.bottomTabEventListener = Navigation.events().registerBottomTabSelectedListener(
({ selectedTabIndex, unselectedTabIndex }) => { ({ selectedTabIndex, unselectedTabIndex }) => {
if(selectedTabIndex == unselectedTabIndex && selectedTabIndex == 1) { if(selectedTabIndex == unselectedTabIndex && selectedTabIndex == 1) {
this.diaryList.scrollToTop(); if(this.diaryList) {
this.diaryList.scrollToTop();
}
} }
} }
); );

View file

@ -54,7 +54,9 @@ export default class HomePage extends Component {
this.bottomTabEventListener = Navigation.events().registerBottomTabSelectedListener( this.bottomTabEventListener = Navigation.events().registerBottomTabSelectedListener(
({ selectedTabIndex, unselectedTabIndex }) => { ({ selectedTabIndex, unselectedTabIndex }) => {
if(selectedTabIndex == unselectedTabIndex && selectedTabIndex == 0) { if(selectedTabIndex == unselectedTabIndex && selectedTabIndex == 0) {
this.diaryList.scrollToTop(); if(this.diaryList) {
this.diaryList.scrollToTop();
}
} }
} }
); );