From 94c3523712f7782f953d0b9c3a7ec0fefc9abd47 Mon Sep 17 00:00:00 2001 From: Kieran Date: Wed, 29 Mar 2023 14:39:23 +0100 Subject: [PATCH] bug: thread location state invalid --- packages/app/src/Element/Thread.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/app/src/Element/Thread.tsx b/packages/app/src/Element/Thread.tsx index 382ebb6..6232312 100644 --- a/packages/app/src/Element/Thread.tsx +++ b/packages/app/src/Element/Thread.tsx @@ -247,7 +247,9 @@ export default function Thread() { // Root is the parent of the current note or the current note if its a root note or the root of the thread const root = useMemo(() => { - const currentNote = thread.data?.find(ne => ne.id === currentId) ?? (location.state as TaggedRawEvent); + const currentNote = + thread.data?.find(ne => ne.id === currentId) ?? + ("sig" in location.state ? (location.state as TaggedRawEvent) : undefined); if (currentNote) { const currentThread = EventExt.extractThread(currentNote); const isRoot = (ne?: ThreadInfo) => ne === undefined;