From 11f42810673793ec5644190bee5c826b7a8e72a1 Mon Sep 17 00:00:00 2001 From: en Date: Tue, 28 Jan 2025 15:36:03 +0100 Subject: [PATCH] feat(ndk): use ndk nip07 signer --- src/layout/header.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layout/header.tsx b/src/layout/header.tsx index 8b6b454..cfbb02a 100644 --- a/src/layout/header.tsx +++ b/src/layout/header.tsx @@ -22,10 +22,11 @@ import { npubToHex } from '../utils' import logo from '../assets/img/DEG Mods Logo With Text.svg' import placeholder from '../assets/img/DEG Mods Default PP.png' import { resetUserWot } from 'store/reducers/wot' +import { NDKNip07Signer } from '@nostr-dev-kit/ndk' export const Header = () => { const dispatch = useAppDispatch() - const { findMetadata } = useNDKContext() + const { findMetadata, ndk } = useNDKContext() const userState = useAppSelector((state) => state.user) const revalidator = useRevalidator() // Track nostr-login extension modal open state @@ -50,6 +51,7 @@ export const Header = () => { dispatch(setAuth(null)) dispatch(setUser(null)) dispatch(resetUserWot()) + ndk.signer = undefined } else { dispatch( setAuth({ @@ -63,6 +65,7 @@ export const Header = () => { pubkey: npubToHex(npub)! }) ) + ndk.signer = new NDKNip07Signer() findMetadata(npub).then((userProfile) => { if (userProfile) { dispatch(