diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-05-18 17:01:48 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-05-18 17:01:48 -0500 |
commit | 324c9209dc5777dcf3019926fb5847f6073fd2e4 (patch) | |
tree | a30fd7e5b5afc7d5513914ecb83625c7070d7bf3 /src | |
parent | ad8778ab10d853b0de59aa25355fdf61ea6f2b57 (diff) | |
download | voidsky-324c9209dc5777dcf3019926fb5847f6073fd2e4.tar.zst |
Only show algos and lists on profiles if there are items
Diffstat (limited to 'src')
-rw-r--r-- | src/state/models/ui/profile.ts | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/state/models/ui/profile.ts b/src/state/models/ui/profile.ts index 54ee461b0..35831d1f7 100644 --- a/src/state/models/ui/profile.ts +++ b/src/state/models/ui/profile.ts @@ -12,13 +12,6 @@ export enum Sections { Lists = 'Lists', } -const USER_SELECTOR_ITEMS = [ - Sections.Posts, - Sections.PostsWithReplies, - Sections.CustomAlgorithms, - Sections.Lists, -] - export interface ProfileUiParams { user: string } @@ -83,7 +76,14 @@ export class ProfileUiModel { } get selectorItems() { - return USER_SELECTOR_ITEMS + const items = [Sections.Posts, Sections.PostsWithReplies] + if (this.algos.hasLoaded && !this.algos.isEmpty) { + items.push(Sections.CustomAlgorithms) + } + if (this.lists.hasLoaded && !this.lists.isEmpty) { + items.push(Sections.Lists) + } + return items } get selectedView() { @@ -166,6 +166,7 @@ export class ProfileUiModel { .setup() .catch(err => this.rootStore.log.error('Failed to fetch feed', err)), ]) + this.algos.refresh() // HACK: need to use the DID as a param, not the username -prf this.lists.source = this.profile.did this.lists |