fixed note
This commit is contained in:
@@ -4,17 +4,16 @@ import { RootNote } from '@components/note/root';
|
||||
import { memo, useMemo } from 'react';
|
||||
|
||||
export const Note = memo(function Note({ event }: { event: any }) {
|
||||
const tags = event.tags.replaceAll("'", '"');
|
||||
const parseTags = JSON.parse(tags);
|
||||
const tags = JSON.parse(event.tags);
|
||||
|
||||
const fetchRootEvent = useMemo(() => {
|
||||
if (parseTags.length > 0) {
|
||||
if (parseTags[0][0] === 'e' || parseTags[0][2] === 'root') {
|
||||
return <RootNote id={parseTags[0][1]} />;
|
||||
if (tags.length > 0) {
|
||||
if (tags[0][0] === 'e' || tags[0][2] === 'root') {
|
||||
return <RootNote id={tags[0][1]} />;
|
||||
} else {
|
||||
parseTags.every((tag) => {
|
||||
tags.every((tag) => {
|
||||
if (tag[0] === 'e' && tag[2] === 'root') {
|
||||
return <RootNote id={parseTags[1]} />;
|
||||
return <RootNote id={tags[1]} />;
|
||||
}
|
||||
return <></>;
|
||||
});
|
||||
@@ -22,7 +21,7 @@ export const Note = memo(function Note({ event }: { event: any }) {
|
||||
} else {
|
||||
return <></>;
|
||||
}
|
||||
}, [parseTags]);
|
||||
}, [tags]);
|
||||
|
||||
return (
|
||||
<div className="relative z-10 flex h-min min-h-min w-full cursor-pointer select-text flex-col border-b border-zinc-800 py-5 px-3 hover:bg-black/20">
|
||||
|
||||
Reference in New Issue
Block a user