bug: null location data on thread

This commit is contained in:
Kieran 2023-03-29 19:09:14 +01:00
parent 0caa1c97db
commit d24fc57962
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
1 changed files with 1 additions and 1 deletions

View File

@ -249,7 +249,7 @@ export default function Thread() {
const root = useMemo(() => {
const currentNote =
thread.data?.find(ne => ne.id === currentId) ??
("sig" in location.state ? (location.state as TaggedRawEvent) : undefined);
(location.state && "sig" in location.state ? (location.state as TaggedRawEvent) : undefined);
if (currentNote) {
const currentThread = EventExt.extractThread(currentNote);
const isRoot = (ne?: ThreadInfo) => ne === undefined;