{['both', 'read'].includes(scope) && (
diff --git a/src/pages/secondary/FollowPacksPage/index.tsx b/src/pages/secondary/FollowPacksPage/index.tsx
index 2329e69..bebec28 100644
--- a/src/pages/secondary/FollowPacksPage/index.tsx
+++ b/src/pages/secondary/FollowPacksPage/index.tsx
@@ -2,6 +2,7 @@ import { Button } from '@/components/ui/button'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
import { Skeleton } from '@/components/ui/skeleton'
import { useFollowList } from '@/providers/FollowListProvider'
+import { useMuteList } from '@/providers/MuteListProvider'
import { useNostr } from '@/providers/NostrProvider'
import { getPubkeysFromPTags } from '@/lib/tag'
import { Event } from 'nostr-tools'
@@ -22,6 +23,7 @@ const FollowPacksPage = forwardRef
([])
const [isLoading, setIsLoading] = useState(true)
const [_followingPacks, setFollowingPacks] = useState>(new Set())
@@ -77,22 +79,29 @@ const FollowPacksPage = forwardRef !followingSet.has(p))
+ // Filter out users that are already followed OR muted
+ const toFollow = packPubkeys.filter(p => !followingSet.has(p) && !mutePubkeySet.has(p))
if (toFollow.length === 0) {
- toast.info(t('You are already following all members of this pack'))
+ const mutedCount = packPubkeys.filter(p => mutePubkeySet.has(p) && !followingSet.has(p)).length
+ if (mutedCount > 0) {
+ toast.info(t('All available members are already followed or muted'))
+ } else {
+ toast.info(t('You are already following all members of this pack'))
+ }
return
}
try {
- // Follow all pubkeys in the pack
+ // Follow all pubkeys in the pack (excluding muted users)
for (const pubkeyToFollow of toFollow) {
await follow(pubkeyToFollow)
}
toast.success(t('Followed {{count}} users', { count: toFollow.length }))
- // Update followingPacks if all members are now followed
- if (packPubkeys.every(p => followingSet.has(p) || toFollow.includes(p))) {
+ // Update followingPacks if all non-muted members are now followed
+ const nonMutedPackPubkeys = packPubkeys.filter(p => !mutePubkeySet.has(p))
+ if (nonMutedPackPubkeys.length > 0 && nonMutedPackPubkeys.every(p => followingSet.has(p) || toFollow.includes(p))) {
setFollowingPacks(prev => new Set([...prev, pack.id]))
}
} catch (error) {
@@ -127,7 +136,7 @@ const FollowPacksPage = forwardRef
+
{t('Please log in')}
{t('You need to be logged in to browse follow packs')}
@@ -137,7 +146,7 @@ const FollowPacksPage = forwardRef
+
{!isLoading && packs.length > 0 && (
@@ -178,8 +187,10 @@ const FollowPacksPage = forwardRef
{
const packPubkeys = getPubkeysFromPTags(pack.tags)
const followingSet = new Set(followings)
- const alreadyFollowingAll = packPubkeys.length > 0 && packPubkeys.every(p => followingSet.has(p))
- const toFollowCount = packPubkeys.filter(p => !followingSet.has(p)).length
+ // Exclude muted users from calculations
+ const availablePubkeys = packPubkeys.filter(p => !mutePubkeySet.has(p))
+ const alreadyFollowingAll = availablePubkeys.length > 0 && availablePubkeys.every(p => followingSet.has(p))
+ const toFollowCount = availablePubkeys.filter(p => !followingSet.has(p)).length
return (
@@ -192,12 +203,12 @@ const FollowPacksPage = forwardRef
- {t('{{count}} profiles', { count: packPubkeys.length })}
+ {t('{{count}} profiles', { count: availablePubkeys.length })}
- {packPubkeys.length > 0 && (
+ {availablePubkeys.length > 0 && (
- {packPubkeys.slice(0, 5).map((pubkey) => (
+ {availablePubkeys.slice(0, 5).map((pubkey) => (
))}
- {packPubkeys.length > 5 && (
+ {availablePubkeys.length > 5 && (
- +{packPubkeys.length - 5}
+ +{availablePubkeys.length - 5}
)}
diff --git a/src/pages/secondary/FollowingListPage/index.tsx b/src/pages/secondary/FollowingListPage/index.tsx
index 481807a..13dfc25 100644
--- a/src/pages/secondary/FollowingListPage/index.tsx
+++ b/src/pages/secondary/FollowingListPage/index.tsx
@@ -14,9 +14,11 @@ const FollowingListPage = forwardRef(({ id, index, hideTitlebar = false }: { id?
ref={ref}
index={index}
title={
- profile?.username
- ? t("username's following", { username: profile.username })
- : t('Following')
+ hideTitlebar
+ ? undefined
+ : profile?.username
+ ? t("username's following", { username: profile.username })
+ : t('Following')
}
hideBackButton={hideTitlebar}
displayScrollToTopButton
diff --git a/src/pages/secondary/MuteListPage/index.tsx b/src/pages/secondary/MuteListPage/index.tsx
index 388b0f9..2e5f451 100644
--- a/src/pages/secondary/MuteListPage/index.tsx
+++ b/src/pages/secondary/MuteListPage/index.tsx
@@ -60,7 +60,7 @@ const MuteListPage = forwardRef(({ index, hideTitlebar = false }: { index?: numb
diff --git a/src/pages/secondary/OthersRelaySettingsPage/index.tsx b/src/pages/secondary/OthersRelaySettingsPage/index.tsx
index 31a8eca..4601ac9 100644
--- a/src/pages/secondary/OthersRelaySettingsPage/index.tsx
+++ b/src/pages/secondary/OthersRelaySettingsPage/index.tsx
@@ -16,7 +16,7 @@ const RelaySettingsPage = forwardRef(({ id, index, hideTitlebar = false }: { id?