mirror of
https://github.com/BlowaterNostr/blowater.git
synced 2024-10-18 15:43:20 +00:00
render nip19 nevent (#309)
This commit is contained in:
parent
6969b847bd
commit
9367d2ba5c
@ -27,6 +27,7 @@ import { SelectConversation } from "./search_model.ts";
|
|||||||
import { AboutIcon } from "./icons/about-icon.tsx";
|
import { AboutIcon } from "./icons/about-icon.tsx";
|
||||||
import { CloseIcon } from "./icons/close-icon.tsx";
|
import { CloseIcon } from "./icons/close-icon.tsx";
|
||||||
import { LeftArrowIcon } from "./icons/left-arrow-icon.tsx";
|
import { LeftArrowIcon } from "./icons/left-arrow-icon.tsx";
|
||||||
|
import { NoteID } from "../lib/nostr-ts/nip19.ts";
|
||||||
import { ChatMessagesGetter } from "./app_update.tsx";
|
import { ChatMessagesGetter } from "./app_update.tsx";
|
||||||
|
|
||||||
export type RightPanelModel = {
|
export type RightPanelModel = {
|
||||||
@ -354,14 +355,14 @@ function MessageBoxGroup(props: {
|
|||||||
<pre
|
<pre
|
||||||
class={tw`text-[#DCDDDE] whitespace-pre-wrap break-words font-roboto text-sm`}
|
class={tw`text-[#DCDDDE] whitespace-pre-wrap break-words font-roboto text-sm`}
|
||||||
>
|
>
|
||||||
{ParseMessageContent(
|
{ParseMessageContent(
|
||||||
first_group,
|
first_group,
|
||||||
props.authorProfile,
|
props.authorProfile,
|
||||||
props.profilesSyncer,
|
props.profilesSyncer,
|
||||||
props.eventSyncer,
|
props.eventSyncer,
|
||||||
props.emit,
|
props.emit,
|
||||||
props.profileGetter,
|
props.profileGetter,
|
||||||
)}
|
)}
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
</li>,
|
</li>,
|
||||||
@ -551,6 +552,17 @@ export function ParseMessageContent(
|
|||||||
vnode.push(Card(event, profile ? profile.profile : undefined, emit));
|
vnode.push(Card(event, profile ? profile.profile : undefined, emit));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "nevent": {
|
||||||
|
const event = eventSyncer.syncEvent(NoteID.FromString(item.event.pointer.id));
|
||||||
|
if (
|
||||||
|
event instanceof Promise || event.kind == NostrKind.DIRECT_MESSAGE
|
||||||
|
) {
|
||||||
|
vnode.push(itemStr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
const profile = profileGetter.getProfilesByPublicKey(event.publicKey);
|
||||||
|
vnode.push(Card(event, profile ? profile.profile : undefined, emit));
|
||||||
|
}
|
||||||
case "tag":
|
case "tag":
|
||||||
// todo
|
// todo
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user