diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-03-13 17:46:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-13 08:46:24 -0700 |
commit | 6cbd9fbc45d2803e6eaea799f4b27a34b8e6ccdd (patch) | |
tree | f8883ccd53642c284ab65d323422db41544c9b0c /src/view/screens | |
parent | c7ba0e4f663afded992c767dc97b8ec08edefec5 (diff) | |
download | voidsky-6cbd9fbc45d2803e6eaea799f4b27a34b8e6ccdd.tar.zst |
Fix lists tab appearing when user has a starterpack but no lists (#7952)
* Fix list tab showing up when no lists * tweak code
Diffstat (limited to 'src/view/screens')
-rw-r--r-- | src/view/screens/Profile.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index f781ba2a8..425d55656 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -208,11 +208,13 @@ function ProfileScreenLoaded({ const showMediaTab = !hasLabeler const showVideosTab = !hasLabeler const showLikesTab = isMe - const showFeedsTab = isMe || (profile.associated?.feedgens || 0) > 0 - const showStarterPacksTab = - isMe || (profile.associated?.starterPacks || 0) > 0 - const showListsTab = - hasSession && (isMe || (profile.associated?.lists || 0) > 0) + const feedGenCount = profile.associated?.feedgens || 0 + const showFeedsTab = isMe || feedGenCount > 0 + const starterPackCount = profile.associated?.starterPacks || 0 + const showStarterPacksTab = isMe || starterPackCount > 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 = [ showFiltersTab ? _(msg`Labels`) : undefined, |