Fix lists tab appearing when user has a starterpack but no lists (#7952)
* Fix list tab showing up when no lists * tweak code
This commit is contained in:
@@ -208,11 +208,13 @@ function ProfileScreenLoaded({
|
|||||||
const showMediaTab = !hasLabeler
|
const showMediaTab = !hasLabeler
|
||||||
const showVideosTab = !hasLabeler
|
const showVideosTab = !hasLabeler
|
||||||
const showLikesTab = isMe
|
const showLikesTab = isMe
|
||||||
const showFeedsTab = isMe || (profile.associated?.feedgens || 0) > 0
|
const feedGenCount = profile.associated?.feedgens || 0
|
||||||
const showStarterPacksTab =
|
const showFeedsTab = isMe || feedGenCount > 0
|
||||||
isMe || (profile.associated?.starterPacks || 0) > 0
|
const starterPackCount = profile.associated?.starterPacks || 0
|
||||||
const showListsTab =
|
const showStarterPacksTab = isMe || starterPackCount > 0
|
||||||
hasSession && (isMe || (profile.associated?.lists || 0) > 0)
|
// subtract starterpack count from list count, since starterpacks are a type of list
|
||||||
|
const listCount = (profile.associated?.lists || 0) - starterPackCount
|
||||||
|
const showListsTab = hasSession && (isMe || listCount > 0)
|
||||||
|
|
||||||
const sectionTitles = [
|
const sectionTitles = [
|
||||||
showFiltersTab ? _(msg`Labels`) : undefined,
|
showFiltersTab ? _(msg`Labels`) : undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user