From c9c8b57e5a2cff155aa67587825df1da440f13d2 Mon Sep 17 00:00:00 2001
From: Ren Amamiya <123083837+reyamir@users.noreply.github.com>
Date: Mon, 17 Apr 2023 08:00:18 +0700
Subject: [PATCH] updated root note
---
src/components/note/parent.tsx | 2 +-
src/components/note/quote.tsx | 2 +-
src/components/note/quoteRepost.tsx | 2 +
src/components/note/rootNote.tsx | 108 ++++++++++++++++++++++------
4 files changed, 92 insertions(+), 22 deletions(-)
diff --git a/src/components/note/parent.tsx b/src/components/note/parent.tsx
index e5fa208f..87dbd82e 100644
--- a/src/components/note/parent.tsx
+++ b/src/components/note/parent.tsx
@@ -15,7 +15,7 @@ export const NoteParent = memo(function NoteParent({ id }: { id: string }) {
const [event, setEvent] = useState(null);
const unsubscribe = useRef(null);
- const content = event ? contentParser(event?.content, event.tags) : '';
+ const content = event ? contentParser(event.content, event.tags) : '';
const fetchEvent = useCallback(async () => {
const { createNote } = await import('@utils/bindings');
diff --git a/src/components/note/quote.tsx b/src/components/note/quote.tsx
index 4e91f61b..d683a548 100644
--- a/src/components/note/quote.tsx
+++ b/src/components/note/quote.tsx
@@ -14,7 +14,7 @@ export const NoteQuote = memo(function NoteQuote({ id }: { id: string }) {
const [event, setEvent] = useState(null);
const unsubscribe = useRef(null);
- const content = contentParser(event.content, event.tags);
+ const content = event ? contentParser(event.content, event.tags) : '';
const fetchEvent = useCallback(async () => {
const { createNote } = await import('@utils/bindings');
diff --git a/src/components/note/quoteRepost.tsx b/src/components/note/quoteRepost.tsx
index a30ea812..d9ac2016 100644
--- a/src/components/note/quoteRepost.tsx
+++ b/src/components/note/quoteRepost.tsx
@@ -9,6 +9,8 @@ export const NoteQuoteRepost = memo(function NoteQuoteRepost({ event }: { event:
if (event.content.length > 0) {
note =