Don't follow self, blocks or mute when following all; don't show blocks in list (#4715)
* don't follow self when following all * also filter blocks * add more filtering to follow all * extract logic to functions
This commit is contained in:
parent
dc3c81c4e2
commit
6694a33603
3 changed files with 27 additions and 2 deletions
|
@ -25,6 +25,7 @@ import {logger} from '#/logger'
|
|||
import {useDeleteStarterPackMutation} from '#/state/queries/starter-packs'
|
||||
import {batchedUpdates} from 'lib/batchedUpdates'
|
||||
import {HITSLOP_20} from 'lib/constants'
|
||||
import {isBlockedOrBlocking, isMuted} from 'lib/moderation/blocked-and-muted'
|
||||
import {makeProfileLink, makeStarterPackLink} from 'lib/routes/links'
|
||||
import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types'
|
||||
import {logEvent} from 'lib/statsig/statsig'
|
||||
|
@ -344,7 +345,13 @@ function Header({
|
|||
list: starterPack.list.uri,
|
||||
})
|
||||
const dids = list.data.items
|
||||
.filter(li => !li.subject.viewer?.following)
|
||||
.filter(
|
||||
li =>
|
||||
li.subject.did !== currentAccount?.did &&
|
||||
!isBlockedOrBlocking(li.subject) &&
|
||||
!isMuted(li.subject) &&
|
||||
!li.subject.viewer?.following,
|
||||
)
|
||||
.map(li => li.subject.did)
|
||||
|
||||
const followUris = await bulkWriteFollows(agent, dids)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue