Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Commit

Permalink
fix: action bar jumps to top when vocabulary list is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyloi committed Jan 12, 2020
1 parent c129327 commit 38fbc62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class CategoryDetailScreen extends React.Component<
);
}

private renderVocabularyList(): null | React.ReactElement<any> {
private renderVocabularyList(): React.ReactElement<any> {
if (
this.props.observableScreen.vocabularyListState.vocabularyList !== null &&
this.props.observableScreen.vocabularyListState.noMore === true &&
Expand All @@ -75,9 +75,7 @@ export class CategoryDetailScreen extends React.Component<
refresh={this.props.screenDelegate.refreshCurrentList}
/>
);
} else if (
this.props.observableScreen.vocabularyListState.vocabularyList !== null
) {
} else {
return (
<VocabularyList
key={this.props.observableScreen.selectedFilterType.get()}
Expand All @@ -93,8 +91,6 @@ export class CategoryDetailScreen extends React.Component<
refresh={this.props.screenDelegate.refreshCurrentList}
/>
);
} else {
return null;
}
}

Expand Down
16 changes: 4 additions & 12 deletions packages/ulangi-mobile/src/views/manage/ManageScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class ManageScreen extends React.Component<ManageScreenProps> {
);
}

private renderVocabularyList(): null | React.ReactElement<any> {
private renderVocabularyList(): React.ReactElement<any> {
if (
this.props.observableScreen.vocabularyListState.vocabularyList !== null &&
this.props.observableScreen.vocabularyListState.noMore === true &&
Expand All @@ -73,9 +73,7 @@ export class ManageScreen extends React.Component<ManageScreenProps> {
showQuickTutorial={this.props.screenDelegate.showQuickTutorial}
/>
);
} else if (
this.props.observableScreen.vocabularyListState.vocabularyList !== null
) {
} else {
return (
<VocabularyList
key={this.props.observableScreen.selectedFilterType.get()}
Expand All @@ -91,12 +89,10 @@ export class ManageScreen extends React.Component<ManageScreenProps> {
refresh={this.props.screenDelegate.refreshCurrentList}
/>
);
} else {
return null;
}
}

private renderCategoryList(): null | React.ReactElement<any> {
private renderCategoryList(): React.ReactElement<any> {
if (
this.props.observableScreen.categoryListState.categoryList !== null &&
this.props.observableScreen.categoryListState.noMore === true &&
Expand All @@ -109,9 +105,7 @@ export class ManageScreen extends React.Component<ManageScreenProps> {
showQuickTutorial={this.props.screenDelegate.showQuickTutorial}
/>
);
} else if (
this.props.observableScreen.categoryListState.categoryList !== null
) {
} else {
return (
<CategoryList
testID={ManageScreenIds.CATEGORY_LIST}
Expand All @@ -135,8 +129,6 @@ export class ManageScreen extends React.Component<ManageScreenProps> {
}
/>
);
} else {
return null;
}
}

Expand Down

0 comments on commit 38fbc62

Please sign in to comment.