Fix to feeds view in profiles (#1171)

* Fix load of feeds tab

* Add e2e test for profile feeds
This commit is contained in:
Paul Frazee 2023-08-15 09:59:49 -07:00 committed by GitHub
parent a3af2a2b85
commit f4891a47a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 17 deletions

View file

@ -114,32 +114,25 @@ export class ProfileUiModel {
},
])
} else {
// not loading, no error, show content
if (
this.selectedView === Sections.PostsNoReplies ||
this.selectedView === Sections.PostsWithReplies ||
this.selectedView === Sections.PostsWithMedia ||
this.selectedView === Sections.CustomAlgorithms
this.selectedView === Sections.PostsWithMedia
) {
if (this.feed.hasContent) {
if (this.selectedView === Sections.CustomAlgorithms) {
arr = this.algos.feeds
} else if (
this.selectedView === Sections.PostsNoReplies ||
this.selectedView === Sections.PostsWithReplies ||
this.selectedView === Sections.PostsWithMedia
) {
arr = this.feed.slices.slice()
} else {
// posts with replies is also default
arr = this.feed.slices.slice()
}
arr = this.feed.slices.slice()
if (!this.feed.hasMore) {
arr = arr.concat([ProfileUiModel.END_ITEM])
}
} else if (this.feed.isEmpty) {
arr = arr.concat([ProfileUiModel.EMPTY_ITEM])
}
} else if (this.selectedView === Sections.CustomAlgorithms) {
if (this.algos.hasContent) {
arr = this.algos.feeds
} else if (this.algos.isEmpty) {
arr = arr.concat([ProfileUiModel.EMPTY_ITEM])
}
} else if (this.selectedView === Sections.Lists) {
if (this.lists.hasContent) {
arr = this.lists.lists

View file

@ -69,6 +69,7 @@ export const CustomFeed = observer(
return (
<TouchableOpacity
testID={`feed-${item.displayName}`}
accessibilityRole="button"
style={[styles.container, pal.border, style]}
onPress={() => {