diff --git a/src/app/nwc/index.tsx b/src/app/nwc/index.tsx index 10f1b133..1fed435e 100644 --- a/src/app/nwc/index.tsx +++ b/src/app/nwc/index.tsx @@ -21,7 +21,7 @@ export function NWCScreen() { }; return ( -
+

diff --git a/src/libs/ndk/instance.ts b/src/libs/ndk/instance.ts index 4335a220..d8306f91 100644 --- a/src/libs/ndk/instance.ts +++ b/src/libs/ndk/instance.ts @@ -40,13 +40,18 @@ export const NDKInstance = () => { const successes = responses.filter((res) => res.ok); const verifiedRelays: string[] = successes.map((res) => { - // TODO: support payment + const url = new URL(res.url); + // @ts-expect-error, not have type yet - if (!res.data.limitation?.payment_required) { - const url = new URL(res.url); - if (url.protocol === 'http:') return `ws://${url.hostname + url.pathname}`; - if (url.protocol === 'https:') return `wss://${url.hostname + url.pathname}`; + if (res.data?.limitation?.payment_required) { + if (url.protocol === 'http:') + return `ws://${url.hostname + url.pathname + db.account.npub}`; + if (url.protocol === 'https:') + return `wss://${url.hostname + url.pathname + db.account.npub}`; } + + if (url.protocol === 'http:') return `ws://${url.hostname + url.pathname}`; + if (url.protocol === 'https:') return `wss://${url.hostname + url.pathname}`; }); // return all validated relays diff --git a/src/shared/accounts/active.tsx b/src/shared/accounts/active.tsx index f4c277f7..0f0c8249 100644 --- a/src/shared/accounts/active.tsx +++ b/src/shared/accounts/active.tsx @@ -25,26 +25,19 @@ export function ActiveAccount() { useEffect(() => { const filter: NDKFilter = { '#p': [db.account.pubkey], - kinds: [ - NDKKind.Text, - NDKKind.Contacts, - NDKKind.Repost, - NDKKind.Reaction, - NDKKind.Zap, - ], + kinds: [NDKKind.Text, NDKKind.Repost, NDKKind.Reaction, NDKKind.Zap], since: Math.floor(Date.now() / 1000), }; sub( filter, async (event) => { + console.log('new notify: ', event); addActivity(event); switch (event.kind) { case NDKKind.Text: return await sendNativeNotification('Mention'); - case NDKKind.Contacts: - return await sendNativeNotification("You've a new follower"); case NDKKind.Repost: return await sendNativeNotification('Repost'); case NDKKind.Reaction: diff --git a/src/shared/notes/kinds/repost.tsx b/src/shared/notes/kinds/repost.tsx index f882aa86..fbeb7dab 100644 --- a/src/shared/notes/kinds/repost.tsx +++ b/src/shared/notes/kinds/repost.tsx @@ -148,7 +148,7 @@ export function Repost({
-
+
{renderKind(data)} diff --git a/src/utils/hooks/useNostr.ts b/src/utils/hooks/useNostr.ts index 53ead8a2..4afbdcad 100644 --- a/src/utils/hooks/useNostr.ts +++ b/src/utils/hooks/useNostr.ts @@ -47,11 +47,13 @@ export function useNostr() { closeOnEose: false, groupable: groupable ?? true, }); - subManager.set(JSON.stringify(filter), subEvent); subEvent.addListener('event', (event: NDKEvent) => { callback(event); }); + + subManager.set(JSON.stringify(filter), subEvent); + console.log(subManager.keys()); }; const fetchUserData = async (preFollows?: string[]) => {