mirror of
https://github.com/smolgrrr/TAO.git
synced 2024-09-20 01:11:25 +00:00
rm navigate
This commit is contained in:
parent
97ea3f2219
commit
3203349573
@ -8,7 +8,6 @@ import { renderMedia } from "../../utils/FileUpload";
|
||||
import { getIconFromHash, timeAgo } from "../../utils/cardUtils";
|
||||
import { verifyPow } from "../../utils/mine";
|
||||
import { uniqBy } from "../../utils/otherUtils";
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
interface CardProps {
|
||||
key?: string | number;
|
||||
@ -30,11 +29,10 @@ const PostCard = ({
|
||||
const { files } = parseContent(event);
|
||||
const icon = getIconFromHash(event.pubkey);
|
||||
const metadataParsed = metadata ? getMetadata(metadata) : null;
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleClick = () => {
|
||||
if (type !== "OP") {
|
||||
navigate(`/thread/${nip19.noteEncode(event.id)}`);
|
||||
window.location.href = `/thread/${nip19.noteEncode(event.id)}`;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -40,10 +40,6 @@ const Thread = () => {
|
||||
// Call your subNote function or do whatever you need to do with id_to_hex
|
||||
subNote(hexID, onEvent);
|
||||
}
|
||||
|
||||
return () => {
|
||||
// Your cleanup code here
|
||||
};
|
||||
}, [id]); // Empty dependency array means this useEffect runs once when the component mounts
|
||||
|
||||
const uniqEvents = events.length > 0 ? uniqBy(events, "id") : [];
|
||||
@ -112,7 +108,7 @@ const Thread = () => {
|
||||
|
||||
const displayedEvents = sortByTime ? eventsSortedByTime : eventsSortedByPow;
|
||||
|
||||
if (!uniqEvents[0]) {
|
||||
if (uniqEvents.length === 0) {
|
||||
return (
|
||||
<Placeholder />
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user