This commit is contained in:
2023-08-22 22:48:37 +01:00
parent d071736d4c
commit 16c54185bb
32 changed files with 57 additions and 49 deletions

View File

@ -29,7 +29,7 @@ export function useUserCards(
const subRelated = useMemo(() => {
if (!pubkey) return null;
const splitted = related.map((t) => t.at(1)!.split(":"));
const splitted = related.map((t) => t[1].split(":"));
const authors = splitted
.map((s) => s.at(1))
.filter((s) => s)
@ -58,7 +58,7 @@ export function useUserCards(
const cards = useMemo(() => {
return related
.map((t) => {
const [k, pubkey, identifier] = t.at(1)!.split(":");
const [k, pubkey, identifier] = t[1].split(":");
const kind = Number(k);
return (data ?? []).find(
(e) =>
@ -104,7 +104,7 @@ export function useCards(pubkey: string, leaveOpen = false): TaggedRawEvent[] {
const subRelated = useMemo(() => {
if (!pubkey) return null;
const splitted = related.map((t) => t.at(1)!.split(":"));
const splitted = related.map((t) => t[1].split(":"));
const authors = splitted
.map((s) => s.at(1))
.filter((s) => s)
@ -134,7 +134,7 @@ export function useCards(pubkey: string, leaveOpen = false): TaggedRawEvent[] {
const cards = useMemo(() => {
return related
.map((t) => {
const [k, pubkey, identifier] = t.at(1)!.split(":");
const [k, pubkey, identifier] = t[1].split(":");
const kind = Number(k);
return cardEvents.find(
(e) =>

View File

@ -45,7 +45,7 @@ export function useUserEmojiPacks(pubkey?: string, userEmoji?: Tags) {
const subRelated = useMemo(() => {
if (!pubkey) return null;
const splitted = related.map((t) => t.at(1)!.split(":"));
const splitted = related.map((t) => t[1].split(":"));
const authors = splitted
.map((s) => s.at(1))
.filter((s) => s)

View File

@ -9,6 +9,7 @@ import {
parseZap,
} from "@snort/system";
import { useRequestBuilder } from "@snort/system-react";
import { unwrap } from "@snort/shared";
import { GOAL } from "const";
import { System } from "index";
@ -43,7 +44,7 @@ export function useZapGoal(host: string, link: NostrLink, leaveOpen = false) {
b.withFilter()
.kinds([GOAL])
.authors([host])
.tag("a", [`${link.kind}:${link.author!}:${link.id}`]);
.tag("a", [`${link.kind}:${unwrap(link.author)}:${link.id}`]);
return b;
}, [link, leaveOpen]);