Only show algos and lists on profiles if there are items
This commit is contained in:
parent
ad8778ab10
commit
324c9209dc
1 changed files with 9 additions and 8 deletions
|
@ -12,13 +12,6 @@ export enum Sections {
|
||||||
Lists = 'Lists',
|
Lists = 'Lists',
|
||||||
}
|
}
|
||||||
|
|
||||||
const USER_SELECTOR_ITEMS = [
|
|
||||||
Sections.Posts,
|
|
||||||
Sections.PostsWithReplies,
|
|
||||||
Sections.CustomAlgorithms,
|
|
||||||
Sections.Lists,
|
|
||||||
]
|
|
||||||
|
|
||||||
export interface ProfileUiParams {
|
export interface ProfileUiParams {
|
||||||
user: string
|
user: string
|
||||||
}
|
}
|
||||||
|
@ -83,7 +76,14 @@ export class ProfileUiModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
get selectorItems() {
|
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() {
|
get selectedView() {
|
||||||
|
@ -166,6 +166,7 @@ export class ProfileUiModel {
|
||||||
.setup()
|
.setup()
|
||||||
.catch(err => this.rootStore.log.error('Failed to fetch feed', err)),
|
.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
|
// HACK: need to use the DID as a param, not the username -prf
|
||||||
this.lists.source = this.profile.did
|
this.lists.source = this.profile.did
|
||||||
this.lists
|
this.lists
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue