mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-17 21:31:43 +01:00
fixed bug with cached note content
This commit is contained in:
parent
7d2d8886dc
commit
c8b6559ae4
148
pnpm-lock.yaml
generated
148
pnpm-lock.yaml
generated
@ -95,25 +95,25 @@ importers:
|
||||
version: 4.9.2(prop-types@15.8.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
applesauce-channel:
|
||||
specifier: next
|
||||
version: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
version: link:../applesauce/packages/channel
|
||||
applesauce-content:
|
||||
specifier: next
|
||||
version: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
version: link:../applesauce/packages/content
|
||||
applesauce-core:
|
||||
specifier: next
|
||||
version: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
version: link:../applesauce/packages/core
|
||||
applesauce-lists:
|
||||
specifier: next
|
||||
version: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
version: link:../applesauce/packages/lists
|
||||
applesauce-net:
|
||||
specifier: next
|
||||
version: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
version: link:../applesauce/packages/net
|
||||
applesauce-react:
|
||||
specifier: next
|
||||
version: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
version: link:../applesauce/packages/react
|
||||
applesauce-signer:
|
||||
specifier: next
|
||||
version: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
version: link:../applesauce/packages/signer
|
||||
bech32:
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0
|
||||
@ -1875,27 +1875,6 @@ packages:
|
||||
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
applesauce-channel@0.0.0-next-20241112141526:
|
||||
resolution: {integrity: sha512-9zKyfcghYY8592BWSjpOAUmAm6Flj5tCG7TPL6sULBzYm3RR6alV6EKqrG/eui5M7hY2OwxTCwruk9gL/3bJNw==}
|
||||
|
||||
applesauce-content@0.0.0-next-20241112141526:
|
||||
resolution: {integrity: sha512-V5VNjZbYK3cBkM6EUp9T5L4Uk4jejmfdYrdFOExX3JN/vPC37gFGBScIM26DMnW33bRsQNlyLJv8Frgf6o50HQ==}
|
||||
|
||||
applesauce-core@0.0.0-next-20241112141526:
|
||||
resolution: {integrity: sha512-CFk5KChWNlY4+J+CWFO1e4c76QbvOeZ/RDl/VXV3q7WUXhXhGGrJInnOyI3SY7vh0PnE9YUL9Zdnmr/QOzqaUw==}
|
||||
|
||||
applesauce-lists@0.0.0-next-20241112141526:
|
||||
resolution: {integrity: sha512-vtlgvEYAAAUzoNQPe9lf0nyMXiyXys4eFpfjUSi7/KvsXvaakNPXzUDRPLBbFr24rj9MYsN6rrYhYdrGBhrZhg==}
|
||||
|
||||
applesauce-net@0.0.0-next-20241112141526:
|
||||
resolution: {integrity: sha512-gzU1OYcC+eCYCcK7BeGoPXu41MszfEYAZnd+LJAI0sXgUwuUFo5lumEpoYYmpqPb0qpP2gL/Zqlvq6J0JQUCHg==}
|
||||
|
||||
applesauce-react@0.0.0-next-20241112141526:
|
||||
resolution: {integrity: sha512-qwVVAz3F+2ENwjWwIYF9Dzlrp59jfaOrFzlMTB70saTmmL1Rj3VVpUAFF4KN5svvrT+AlzLH58T7I5nIv+r2hw==}
|
||||
|
||||
applesauce-signer@0.0.0-next-20241112141526:
|
||||
resolution: {integrity: sha512-s9HEW8hPSAE2Wd2UDj2G08qbzSndxwhVr+gqKdsnNupuVEiO2dWz5ObyDOIuw8k+gzKnaTvCNs1CN/aB8PgXNA==}
|
||||
|
||||
argparse@1.0.10:
|
||||
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
|
||||
|
||||
@ -3693,9 +3672,6 @@ packages:
|
||||
remark-wiki-link@2.0.1:
|
||||
resolution: {integrity: sha512-F8Eut1E7GWfFm4ZDTI6/4ejeZEHZgnVk6E933Yqd/ssYsc4AyI32aGakxwsGcEzbbE7dkWi1EfLlGAdGgOZOsA==}
|
||||
|
||||
remark@15.0.1:
|
||||
resolution: {integrity: sha512-Eht5w30ruCXgFmxVUSlNWQ9iiimq07URKeFS3hNc8cUWy1llX4KDWfyEDZRycMc+znsN9Ux5/tJ/BFdgdOwA3A==}
|
||||
|
||||
remove-accents@0.5.0:
|
||||
resolution: {integrity: sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A==}
|
||||
|
||||
@ -4322,12 +4298,6 @@ packages:
|
||||
zen-observable@0.10.0:
|
||||
resolution: {integrity: sha512-iI3lT0iojZhKwT5DaFy2Ce42n3yFcLdFyOh01G7H0flMY60P8MJuVFEoJoNwXlmAyQ45GrjL6AcZmmlv8A5rbw==}
|
||||
|
||||
zen-observable@0.9.0:
|
||||
resolution: {integrity: sha512-xBrvSw1htnb2VEYpgjG7etqztHSZ4KyKzJgFh/rucI7QzkbxD0rVNmIni6lia6KhWs7RBbBBLZksGKrCSaDAMQ==}
|
||||
|
||||
zen-push@0.3.1:
|
||||
resolution: {integrity: sha512-6XNTSVz8Z/5+8BzOQFQr+HOr/j7K+ZJfc4tdCCmuiq8y2Ph+aODqagZnXKbKIFZrQ3nSIcdek9gAuEe+p3zJUg==}
|
||||
|
||||
zustand@4.5.5:
|
||||
resolution: {integrity: sha512-+0PALYNJNgK6hldkgDq2vLrw5f6g/jCInz52n9RTpropGgeAf/ioFUCdtsjCqu4gNhW9D01rUQBROoRjdzyn2Q==}
|
||||
engines: {node: '>=12.7.0'}
|
||||
@ -6167,95 +6137,6 @@ snapshots:
|
||||
dependencies:
|
||||
color-convert: 2.0.1
|
||||
|
||||
applesauce-channel@0.0.0-next-20241112141526(typescript@5.6.3):
|
||||
dependencies:
|
||||
applesauce-core: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
nostr-tools: 2.10.1(typescript@5.6.3)
|
||||
rxjs: 7.8.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
applesauce-content@0.0.0-next-20241112141526(typescript@5.6.3):
|
||||
dependencies:
|
||||
'@cashu/cashu-ts': 2.0.0-rc1
|
||||
'@types/hast': 3.0.4
|
||||
'@types/mdast': 4.0.4
|
||||
'@types/unist': 3.0.3
|
||||
applesauce-core: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
mdast-util-find-and-replace: 3.0.1
|
||||
nostr-tools: 2.10.1(typescript@5.6.3)
|
||||
remark: 15.0.1
|
||||
remark-parse: 11.0.0
|
||||
unified: 11.0.5
|
||||
unist-util-visit-parents: 6.0.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
applesauce-core@0.0.0-next-20241112141526(typescript@5.6.3):
|
||||
dependencies:
|
||||
debug: 4.3.7
|
||||
json-stringify-deterministic: 1.0.12
|
||||
light-bolt11-decoder: 3.2.0
|
||||
nanoid: 5.0.8
|
||||
nostr-tools: 2.10.1(typescript@5.6.3)
|
||||
rxjs: 7.8.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
applesauce-lists@0.0.0-next-20241112141526(typescript@5.6.3):
|
||||
dependencies:
|
||||
'@noble/hashes': 1.5.0
|
||||
'@noble/secp256k1': 1.7.1
|
||||
'@scure/base': 1.1.9
|
||||
'@types/dom-serial': 1.0.6
|
||||
applesauce-core: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
debug: 4.3.7
|
||||
nostr-tools: 2.10.1(typescript@5.6.3)
|
||||
rxjs: 7.8.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
applesauce-net@0.0.0-next-20241112141526(typescript@5.6.3):
|
||||
dependencies:
|
||||
applesauce-core: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
nanoid: 5.0.8
|
||||
nostr-tools: 2.10.1(typescript@5.6.3)
|
||||
rxjs: 7.8.1
|
||||
zen-push: 0.3.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
applesauce-react@0.0.0-next-20241112141526(typescript@5.6.3):
|
||||
dependencies:
|
||||
applesauce-content: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
applesauce-core: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
nostr-tools: 2.10.1(typescript@5.6.3)
|
||||
react: 18.3.1
|
||||
rxjs: 7.8.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
applesauce-signer@0.0.0-next-20241112141526(typescript@5.6.3):
|
||||
dependencies:
|
||||
'@noble/hashes': 1.5.0
|
||||
'@noble/secp256k1': 1.7.1
|
||||
'@scure/base': 1.1.9
|
||||
'@types/dom-serial': 1.0.6
|
||||
applesauce-core: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
applesauce-net: 0.0.0-next-20241112141526(typescript@5.6.3)
|
||||
debug: 4.3.7
|
||||
nanoid: 5.0.8
|
||||
nostr-tools: 2.10.1(typescript@5.6.3)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
argparse@1.0.10:
|
||||
dependencies:
|
||||
sprintf-js: 1.0.3
|
||||
@ -8439,15 +8320,6 @@ snapshots:
|
||||
mdast-util-wiki-link: 0.1.2
|
||||
micromark-extension-wiki-link: 0.0.4
|
||||
|
||||
remark@15.0.1:
|
||||
dependencies:
|
||||
'@types/mdast': 4.0.4
|
||||
remark-parse: 11.0.0
|
||||
remark-stringify: 11.0.0
|
||||
unified: 11.0.5
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
remove-accents@0.5.0: {}
|
||||
|
||||
repeat-string@1.6.1: {}
|
||||
@ -9149,12 +9021,6 @@ snapshots:
|
||||
|
||||
zen-observable@0.10.0: {}
|
||||
|
||||
zen-observable@0.9.0: {}
|
||||
|
||||
zen-push@0.3.1:
|
||||
dependencies:
|
||||
zen-observable: 0.9.0
|
||||
|
||||
zustand@4.5.5(@types/react@18.3.12)(react@18.3.1):
|
||||
dependencies:
|
||||
use-sync-external-store: 1.2.2(react@18.3.1)
|
||||
|
@ -4,13 +4,15 @@ import { Root, truncateContent } from "applesauce-content/nast";
|
||||
|
||||
import { DraftNostrEvent, NostrEvent } from "../types/nostr-event";
|
||||
import { LightboxProvider } from "./lightbox-provider";
|
||||
import { nostrMentions, emojis, hashtags } from "applesauce-content/text";
|
||||
import { nostrMentions, emojis, hashtags, links } from "applesauce-content/text";
|
||||
import { useRenderedContent } from "applesauce-react/hooks";
|
||||
import { components } from "./content";
|
||||
import { renderGenericUrl } from "./content/links/common";
|
||||
|
||||
const linkRenderers = [renderGenericUrl];
|
||||
|
||||
const CompactNoteContentSymbol = Symbol.for("compact-note-content");
|
||||
|
||||
export type NoteContentsProps = {
|
||||
event: NostrEvent | DraftNostrEvent;
|
||||
textOnly?: boolean;
|
||||
@ -22,6 +24,7 @@ export const CompactNoteContent = React.memo(
|
||||
const truncated = useRef(false);
|
||||
const transformers = useMemo(
|
||||
() => [
|
||||
links,
|
||||
nostrMentions,
|
||||
emojis,
|
||||
hashtags,
|
||||
@ -32,7 +35,12 @@ export const CompactNoteContent = React.memo(
|
||||
],
|
||||
[maxLength],
|
||||
);
|
||||
const content = useRenderedContent(event, components, { transformers, linkRenderers, maxLength });
|
||||
const content = useRenderedContent(event, components, {
|
||||
transformers,
|
||||
linkRenderers,
|
||||
maxLength,
|
||||
cacheKey: CompactNoteContentSymbol,
|
||||
});
|
||||
|
||||
return (
|
||||
<LightboxProvider>
|
||||
|
@ -2,7 +2,7 @@ import React, { Suspense, useMemo } from "react";
|
||||
import { Box, BoxProps, Spinner } from "@chakra-ui/react";
|
||||
import { EventTemplate, NostrEvent } from "nostr-tools";
|
||||
import { useRenderedContent } from "applesauce-react/hooks";
|
||||
import { defaultTransformers, galleries } from "applesauce-content/text";
|
||||
import { textNoteTransformers, TextNoteContentSymbol, galleries } from "applesauce-content/text";
|
||||
|
||||
import {
|
||||
renderWavlakeUrl,
|
||||
@ -30,7 +30,7 @@ import MediaOwnerProvider from "../../../providers/local/media-owner-provider";
|
||||
import { components } from "../../content";
|
||||
import { nipDefinitions } from "../../content/transform/nip-notation";
|
||||
|
||||
const transformers = [...defaultTransformers, galleries, nipDefinitions];
|
||||
const transformers = [...textNoteTransformers, galleries, nipDefinitions];
|
||||
|
||||
export type TextNoteContentsProps = {
|
||||
event: NostrEvent | EventTemplate;
|
||||
@ -62,7 +62,12 @@ const linkRenderers = [
|
||||
|
||||
export const TextNoteContents = React.memo(
|
||||
({ event, noOpenGraphLinks, maxLength, ...props }: TextNoteContentsProps & Omit<BoxProps, "children">) => {
|
||||
const content = useRenderedContent(event, components, { linkRenderers, transformers, maxLength });
|
||||
const content = useRenderedContent(event, components, {
|
||||
linkRenderers,
|
||||
transformers,
|
||||
maxLength,
|
||||
cacheKey: TextNoteContentSymbol,
|
||||
});
|
||||
|
||||
return (
|
||||
<MediaOwnerProvider owner={(event as NostrEvent).pubkey as string | undefined}>
|
||||
|
@ -9,9 +9,15 @@ import { components } from "../content";
|
||||
const transformers = [nostrMentions];
|
||||
const linkRenderers = [renderGenericUrl];
|
||||
|
||||
export default function UserAbout({ pubkey, ...props }: { pubkey: string } & Omit<BoxProps, "children">) {
|
||||
const ProfileAboutContentSymbol = Symbol.for("profile-about-content");
|
||||
|
||||
export default function UserAboutContent({ pubkey, ...props }: { pubkey: string } & Omit<BoxProps, "children">) {
|
||||
const profile = useUserProfile(pubkey);
|
||||
const content = useRenderedContent(profile?.about, components, { transformers, linkRenderers });
|
||||
const content = useRenderedContent(profile?.about, components, {
|
||||
transformers,
|
||||
linkRenderers,
|
||||
cacheKey: ProfileAboutContentSymbol,
|
||||
});
|
||||
|
||||
return (
|
||||
<Box whiteSpace="pre-line" {...props}>
|
||||
|
@ -44,8 +44,10 @@ const linkRenderers = [
|
||||
renderGenericUrl,
|
||||
];
|
||||
|
||||
const ChannelMessageContentSymbol = Symbol.for("channel-message-content");
|
||||
|
||||
const ChannelMessageContent = memo(({ message, children, ...props }: BoxProps & { message: NostrEvent }) => {
|
||||
const content = useRenderedContent(message, components, { linkRenderers });
|
||||
const content = useRenderedContent(message, components, { linkRenderers, cacheKey: ChannelMessageContentSymbol });
|
||||
|
||||
return (
|
||||
<TrustProvider event={message}>
|
||||
|
@ -9,6 +9,8 @@ import { renderGenericUrl } from "../../../components/content/links";
|
||||
|
||||
const linkRenderers = [renderGenericUrl];
|
||||
|
||||
const CommunityDescriptionSymbol = Symbol.for("community-description-content");
|
||||
|
||||
export default function CommunityDescription({
|
||||
community,
|
||||
maxLength,
|
||||
@ -20,6 +22,7 @@ export default function CommunityDescription({
|
||||
const content = useRenderedContent(description, components, {
|
||||
maxLength: showAll ? undefined : maxLength,
|
||||
linkRenderers,
|
||||
cacheKey: CommunityDescriptionSymbol,
|
||||
});
|
||||
|
||||
return (
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { Box, BoxProps } from "@chakra-ui/react";
|
||||
import { useRenderedContent } from "applesauce-react/hooks";
|
||||
import { defaultTransformers } from "applesauce-content/text";
|
||||
|
||||
import { NostrEvent } from "../../../types/nostr-event";
|
||||
import {
|
||||
@ -25,8 +24,8 @@ import { LightboxProvider } from "../../../components/lightbox-provider";
|
||||
import { renderAudioUrl } from "../../../components/content/links/audio";
|
||||
import { components } from "../../../components/content";
|
||||
import { useKind4Decrypt } from "../../../hooks/use-kind4-decryption";
|
||||
import { fedimintTokens } from "../../../helpers/fedimint";
|
||||
|
||||
const DirectMessageContentSymbol = Symbol.for("direct-message-content");
|
||||
const linkRenderers = [
|
||||
renderSimpleXLink,
|
||||
renderYoutubeURL,
|
||||
@ -53,7 +52,7 @@ export default function DirectMessageContent({
|
||||
...props
|
||||
}: { event: NostrEvent; text: string } & BoxProps) {
|
||||
const { plaintext } = useKind4Decrypt(event);
|
||||
const content = useRenderedContent(plaintext, components, { linkRenderers });
|
||||
const content = useRenderedContent(plaintext, components, { linkRenderers, cacheKey: DirectMessageContentSymbol });
|
||||
|
||||
return (
|
||||
<TrustProvider event={event}>
|
||||
|
@ -110,7 +110,9 @@ function MediaServersPage() {
|
||||
<Flex gap="2" direction="column" overflow="auto hidden" flex={1} px="2">
|
||||
<Flex gap="2" alignItems="center">
|
||||
<BackButton hideFrom="lg" size="sm" />
|
||||
<Heading size="lg">Media Servers</Heading>
|
||||
<Heading size="lg" mt="2">
|
||||
Media Servers
|
||||
</Heading>
|
||||
{event && <DebugEventButton event={event} size="sm" ml="auto" />}
|
||||
</Flex>
|
||||
<Text fontStyle="italic" mt="-2">
|
||||
|
@ -9,7 +9,7 @@ import UserDnsIdentity from "../../../components/user/user-dns-identity";
|
||||
import trustedUserStatsService from "../../../services/trusted-user-stats";
|
||||
import { readablizeSats } from "../../../helpers/bolt11";
|
||||
import replaceableEventsService from "../../../services/replaceable-events";
|
||||
import UserAbout from "../../../components/user/user-about";
|
||||
import UserAboutContent from "../../../components/user/user-about";
|
||||
import UserName from "../../../components/user/user-name";
|
||||
import HoverLinkOverlay from "../../../components/hover-link-overlay";
|
||||
import { useWebOfTrust } from "../../../providers/global/web-of-trust-provider";
|
||||
@ -40,7 +40,7 @@ function ProfileResult({ profile }: { profile: NostrEvent }) {
|
||||
<UserDnsIdentity pubkey={profile.pubkey} isTruncated />
|
||||
</Flex>
|
||||
</Flex>
|
||||
<UserAbout pubkey={profile.pubkey} noOfLines={3} isTruncated />
|
||||
<UserAboutContent pubkey={profile.pubkey} noOfLines={3} isTruncated />
|
||||
{stats && (
|
||||
<>{stats.followers_pubkey_count && <Text>Followers: {readablizeSats(stats.followers_pubkey_count)}</Text>}</>
|
||||
)}
|
||||
|
@ -5,10 +5,11 @@ import { ParsedStream } from "../../../helpers/nostr/stream";
|
||||
import { renderGenericUrl, renderImageUrl } from "../../../components/content/links";
|
||||
import { components } from "../../../components/content";
|
||||
|
||||
const StreamSummaryContentSymbol = Symbol.for("stream-summary-content");
|
||||
const linkRenderers = [renderImageUrl, renderGenericUrl];
|
||||
|
||||
export default function StreamSummaryContent({ stream, ...props }: BoxProps & { stream: ParsedStream }) {
|
||||
const content = useRenderedContent(stream.event, components, { linkRenderers });
|
||||
const content = useRenderedContent(stream.event, components, { linkRenderers, cacheKey: StreamSummaryContentSymbol });
|
||||
|
||||
return (
|
||||
content && (
|
||||
|
@ -11,10 +11,11 @@ import { NostrEvent } from "../../../../types/nostr-event";
|
||||
import { useRenderedContent } from "applesauce-react/hooks";
|
||||
import { components } from "../../../../components/content";
|
||||
|
||||
const StreamChatMessageContentSymbol = Symbol.for("stream-chat-message-content");
|
||||
const linkRenderers = [renderImageUrl, renderWavlakeUrl, renderStemstrUrl, renderSoundCloudUrl, renderGenericUrl];
|
||||
|
||||
const ChatMessageContent = React.memo(({ event }: { event: NostrEvent }) => {
|
||||
const content = useRenderedContent(event, components, { linkRenderers });
|
||||
const content = useRenderedContent(event, components, { linkRenderers, cacheKey: StreamChatMessageContentSymbol });
|
||||
|
||||
return <>{content}</>;
|
||||
});
|
||||
|
@ -18,7 +18,6 @@ import {
|
||||
useDisclosure,
|
||||
} from "@chakra-ui/react";
|
||||
import { nip19 } from "nostr-tools";
|
||||
import { useRenderedContent } from "applesauce-react/hooks";
|
||||
import { ChatIcon } from "@chakra-ui/icons";
|
||||
|
||||
import { getLudEndpoint } from "../../../helpers/lnurl";
|
||||
@ -50,8 +49,8 @@ import UserJoinedChanneled from "./user-joined-channels";
|
||||
import { getTextColor } from "../../../helpers/color";
|
||||
import UserName from "../../../components/user/user-name";
|
||||
import { useUserDNSIdentity } from "../../../hooks/use-user-dns-identity";
|
||||
import { components } from "../../../components/content";
|
||||
import { renderGenericUrl } from "../../../components/content/links/common";
|
||||
import UserAboutContent from "../../../components/user/user-about";
|
||||
|
||||
function DNSIdentityWarning({ pubkey }: { pubkey: string }) {
|
||||
const metadata = useUserProfile(pubkey);
|
||||
@ -89,8 +88,6 @@ function DNSIdentityWarning({ pubkey }: { pubkey: string }) {
|
||||
);
|
||||
}
|
||||
|
||||
const linkRenderers = [renderGenericUrl];
|
||||
|
||||
export default function UserAboutTab() {
|
||||
const expanded = useDisclosure();
|
||||
const { pubkey } = useOutletContext() as { pubkey: string };
|
||||
@ -102,7 +99,6 @@ export default function UserAboutTab() {
|
||||
const nprofile = useSharableProfileId(pubkey);
|
||||
const pubkeyColor = "#" + pubkey.slice(0, 6);
|
||||
|
||||
const aboutContent = useRenderedContent(metadata?.about, components, { linkRenderers });
|
||||
const parsedNip05 = metadata?.nip05 ? parseAddress(metadata.nip05) : undefined;
|
||||
const nip05URL = parsedNip05
|
||||
? `https://${parsedNip05.domain}/.well-known/nostr.json?name=${parsedNip05.name}`
|
||||
@ -173,11 +169,7 @@ export default function UserAboutTab() {
|
||||
position="absolute"
|
||||
/>
|
||||
</Box>
|
||||
{aboutContent && (
|
||||
<Box whiteSpace="pre-wrap" px="2">
|
||||
{aboutContent}
|
||||
</Box>
|
||||
)}
|
||||
<UserAboutContent pubkey={pubkey} />
|
||||
|
||||
<Flex gap="2" px="2" direction="column">
|
||||
<Flex gap="2">
|
||||
|
@ -26,6 +26,7 @@ import useEventIntersectionRef from "../../hooks/use-event-intersection-ref";
|
||||
import { components } from "../../components/content";
|
||||
import { renderGenericUrl } from "../../components/content/links/common";
|
||||
|
||||
const ZapContentSymbol = Symbol.for("zap-content");
|
||||
const linkRenderers = [renderGenericUrl];
|
||||
|
||||
const Zap = ({ zap }: { zap: NostrEvent }) => {
|
||||
@ -56,7 +57,7 @@ const Zap = ({ zap }: { zap: NostrEvent }) => {
|
||||
eventJSX = <EmbedEventPointer pointer={{ type: "note", data: eventId }} />;
|
||||
}
|
||||
|
||||
const content = useRenderedContent(request, components, { linkRenderers });
|
||||
const content = useRenderedContent(request, components, { linkRenderers, cacheKey: ZapContentSymbol });
|
||||
|
||||
return (
|
||||
<Box ref={ref}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user