feat: support NIP22 for comment
This commit is contained in:
@@ -99,14 +99,9 @@ function ReplyList() {
|
||||
const res = await commands.getReplies(id);
|
||||
|
||||
if (res.status === "ok") {
|
||||
const events = res.data
|
||||
// Create Lume Events
|
||||
.map((item) => LumeEvent.from(item.raw, item.parsed))
|
||||
// Filter quote
|
||||
.filter(
|
||||
(ev) =>
|
||||
!ev.tags.filter((t) => t[0] === "q" || t[3] === "mention").length,
|
||||
);
|
||||
const events = res.data.map((item) =>
|
||||
LumeEvent.from(item.raw, item.parsed),
|
||||
);
|
||||
|
||||
return events;
|
||||
} else {
|
||||
@@ -179,7 +174,7 @@ function ReplyList() {
|
||||
|
||||
useEffect(() => {
|
||||
const unlisten = getCurrentWindow().listen<EventPayload>(
|
||||
"event",
|
||||
"comment",
|
||||
async (data) => {
|
||||
const event = LumeEvent.from(data.payload.raw, data.payload.parsed);
|
||||
|
||||
@@ -216,7 +211,7 @@ function ReplyList() {
|
||||
{isLoading ? (
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<Spinner className="size-4" />
|
||||
<span className="text-sm font-medium">Getting replies...</span>
|
||||
<span className="text-sm font-medium">Loading replies...</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col gap-3">
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
import { commands } from "@/commands.gen";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/columns/_layout/events/$id")({
|
||||
beforeLoad: async () => {
|
||||
const accounts = await commands.getAccounts();
|
||||
return { accounts };
|
||||
},
|
||||
});
|
||||
export const Route = createFileRoute("/columns/_layout/events/$id")();
|
||||
|
||||
@@ -70,7 +70,7 @@ export const Route = createLazyFileRoute("/new-post/")({
|
||||
|
||||
function Screen() {
|
||||
const { reply_to } = Route.useSearch();
|
||||
const { accounts, initialValue, queryClient } = Route.useRouteContext();
|
||||
const { accounts, initialValue } = Route.useRouteContext();
|
||||
const { deferMentionList } = Route.useLoaderData();
|
||||
const users = useAwaited({ promise: deferMentionList })[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user