feat: hide content mentioning muted users (#524)

Co-authored-by: mleku <me@mleku.dev>
This commit is contained in:
Cody Tseng 2025-09-02 22:18:34 +08:00 committed by GitHub
parent d3578184fb
commit 3c657dfa8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 289 additions and 83 deletions

View file

@ -18,10 +18,10 @@ export default function MuteButton({ pubkey }: { pubkey: string }) {
const { t } = useTranslation()
const { isSmallScreen } = useScreenSize()
const { pubkey: accountPubkey, checkLogin } = useNostr()
const { mutePubkeys, changing, mutePubkeyPrivately, mutePubkeyPublicly, unmutePubkey } =
const { mutePubkeySet, changing, mutePubkeyPrivately, mutePubkeyPublicly, unmutePubkey } =
useMuteList()
const [updating, setUpdating] = useState(false)
const isMuted = useMemo(() => mutePubkeys.includes(pubkey), [mutePubkeys, pubkey])
const isMuted = useMemo(() => mutePubkeySet.has(pubkey), [mutePubkeySet, pubkey])
if (!accountPubkey || (pubkey && pubkey === accountPubkey)) return null