diff --git a/ui/src/components/Sidebar/Sidebar.tsx b/ui/src/components/Sidebar/Sidebar.tsx index 04ba048dae..a97b83bed3 100644 --- a/ui/src/components/Sidebar/Sidebar.tsx +++ b/ui/src/components/Sidebar/Sidebar.tsx @@ -63,10 +63,12 @@ export default function Sidebar() { const flagsToFilter = useMemo(() => { const flags = new Set(); Object.entries(pinnedGroups).forEach(([flag]) => flags.add(flag)); + Object.entries(invitedGroups).forEach(([flag]) => flags.add(flag)); loadingGroups.forEach(([flag]) => flags.add(flag)); newGroups?.forEach(([flag]) => flags.add(flag)); + gangsWithClaims.forEach((flag) => flags.add(flag)); return flags; - }, [pinnedGroups, loadingGroups, newGroups]); + }, [pinnedGroups, loadingGroups, newGroups, gangsWithClaims, invitedGroups]); const allOtherGroups = useMemo( () => sortedGroups.filter(([flag, _g]) => !flagsToFilter.has(flag)), diff --git a/ui/src/nav/MobileRoot.tsx b/ui/src/nav/MobileRoot.tsx index 4726ff8ff5..981be834c3 100644 --- a/ui/src/nav/MobileRoot.tsx +++ b/ui/src/nav/MobileRoot.tsx @@ -59,6 +59,22 @@ export default function MobileRoot() { const hasNewGroups = !!newGroups.length; const hasPendingGangs = Object.keys(pendingGangs).length > 0; + // get all non-segmented groups + const flagsToFilter = useMemo(() => { + const flags = new Set(); + Object.entries(pinnedGroups).forEach(([flag]) => flags.add(flag)); + Object.entries(pendingGangs).forEach(([flag]) => flags.add(flag)); + loadingGroups.forEach(([flag]) => flags.add(flag)); + newGroups?.forEach(([flag]) => flags.add(flag)); + gangsWithClaims.forEach((flag) => flags.add(flag)); + return flags; + }, [pinnedGroups, loadingGroups, newGroups, gangsWithClaims, pendingGangs]); + + const allOtherGroups = useMemo( + () => sortedGroups.filter(([flag, _g]) => !flagsToFilter.has(flag)), + [sortedGroups, flagsToFilter] + ); + return ( ) : ( - + {hasPinnedGroups || hasPendingGangs || hasGangsWithClaims ||