bug: thread navigation reload

This commit is contained in:
Kieran 2023-04-25 11:20:33 +01:00
parent 1e11e6a1a2
commit e09df95adf
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 3 additions and 7 deletions

View File

@ -215,13 +215,12 @@ export default function Note(props: NoteProps) {
return;
}
e.stopPropagation();
if (props.onClick) {
e.stopPropagation();
props.onClick(eTarget);
return;
}
e.stopPropagation();
const link = eventLink(eTarget.id, eTarget.relays);
// detect cmd key and open in new tab
if (e.metaKey) {

View File

@ -2,7 +2,7 @@ import "./Thread.css";
import { useMemo, useState, ReactNode } from "react";
import { useIntl } from "react-intl";
import { useNavigate, useLocation, Link, useParams } from "react-router-dom";
import { TaggedRawEvent, u256, EventKind, encodeTLV, NostrPrefix } from "@snort/nostr";
import { TaggedRawEvent, u256, EventKind, NostrPrefix } from "@snort/nostr";
import { EventExt, Thread as ThreadInfo } from "System/EventExt";
import { eventLink, unwrap, getReactions, parseNostrLink, getAllReactions, findTag } from "Util";
@ -221,10 +221,7 @@ export default function Thread() {
function navigateThread(e: TaggedRawEvent) {
setCurrentId(e.id);
const link = encodeTLV(e.id, NostrPrefix.Event, e.relays);
navigate(`/e/${link}`, {
replace: true,
});
//const link = encodeTLV(e.id, NostrPrefix.Event, e.relays);
}
const chains = useMemo(() => {