feat: hide untrusted content button
This commit is contained in:
parent
5913cc3b88
commit
963051e70d
12 changed files with 177 additions and 57 deletions
|
|
@ -25,7 +25,7 @@ export const useNotification = () => {
|
|||
|
||||
export function NotificationProvider({ children }: { children: React.ReactNode }) {
|
||||
const { pubkey, notificationsSeenAt, updateNotificationsSeenAt } = useNostr()
|
||||
const { isUserTrusted } = useUserTrust()
|
||||
const { hideUntrustedNotifications, isUserTrusted } = useUserTrust()
|
||||
const { mutePubkeys } = useMuteList()
|
||||
const [newNotificationIds, setNewNotificationIds] = useState(new Set<string>())
|
||||
const subCloserRef = useRef<SubCloser | null>(null)
|
||||
|
|
@ -66,7 +66,7 @@ export function NotificationProvider({ children }: { children: React.ReactNode }
|
|||
if (
|
||||
evt.pubkey !== pubkey &&
|
||||
!mutePubkeys.includes(evt.pubkey) &&
|
||||
isUserTrusted(evt.pubkey)
|
||||
(!hideUntrustedNotifications || isUserTrusted(evt.pubkey))
|
||||
) {
|
||||
setNewNotificationIds((prev) => new Set([...prev, evt.id]))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue