diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-08-15 09:59:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-15 09:59:49 -0700 |
commit | f4891a47a17cdcd35751867153f73350c90a8f72 (patch) | |
tree | 97d1a20437470ff1718561b3ec28e18865607c64 /src/state/models/ui/profile.ts | |
parent | a3af2a2b850f5561d5a0b9504e0b6ea9aca07cb7 (diff) | |
download | voidsky-f4891a47a17cdcd35751867153f73350c90a8f72.tar.zst |
Fix to feeds view in profiles (#1171)
* Fix load of feeds tab * Add e2e test for profile feeds
Diffstat (limited to 'src/state/models/ui/profile.ts')
-rw-r--r-- | src/state/models/ui/profile.ts | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/state/models/ui/profile.ts b/src/state/models/ui/profile.ts index a8c8ec0a0..9dae09ec5 100644 --- a/src/state/models/ui/profile.ts +++ b/src/state/models/ui/profile.ts @@ -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 |