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 { getIconFromHash, timeAgo } from "../../utils/cardUtils";
|
||||||
import { verifyPow } from "../../utils/mine";
|
import { verifyPow } from "../../utils/mine";
|
||||||
import { uniqBy } from "../../utils/otherUtils";
|
import { uniqBy } from "../../utils/otherUtils";
|
||||||
import { useNavigate } from 'react-router-dom';
|
|
||||||
|
|
||||||
interface CardProps {
|
interface CardProps {
|
||||||
key?: string | number;
|
key?: string | number;
|
||||||
@ -30,11 +29,10 @@ const PostCard = ({
|
|||||||
const { files } = parseContent(event);
|
const { files } = parseContent(event);
|
||||||
const icon = getIconFromHash(event.pubkey);
|
const icon = getIconFromHash(event.pubkey);
|
||||||
const metadataParsed = metadata ? getMetadata(metadata) : null;
|
const metadataParsed = metadata ? getMetadata(metadata) : null;
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
if (type !== "OP") {
|
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
|
// Call your subNote function or do whatever you need to do with id_to_hex
|
||||||
subNote(hexID, onEvent);
|
subNote(hexID, onEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
|
||||||
// Your cleanup code here
|
|
||||||
};
|
|
||||||
}, [id]); // Empty dependency array means this useEffect runs once when the component mounts
|
}, [id]); // Empty dependency array means this useEffect runs once when the component mounts
|
||||||
|
|
||||||
const uniqEvents = events.length > 0 ? uniqBy(events, "id") : [];
|
const uniqEvents = events.length > 0 ? uniqBy(events, "id") : [];
|
||||||
@ -112,7 +108,7 @@ const Thread = () => {
|
|||||||
|
|
||||||
const displayedEvents = sortByTime ? eventsSortedByTime : eventsSortedByPow;
|
const displayedEvents = sortByTime ? eventsSortedByTime : eventsSortedByPow;
|
||||||
|
|
||||||
if (!uniqEvents[0]) {
|
if (uniqEvents.length === 0) {
|
||||||
return (
|
return (
|
||||||
<Placeholder />
|
<Placeholder />
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user