diff options
| author | polwex <polwex@sortug.com> | 2025-11-19 05:47:30 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-11-19 05:47:30 +0700 |
| commit | 74d84cb2f22600b6246343e9ea606cf0db7517f0 (patch) | |
| tree | 0d68285c8e74e6543645e17ab2751d543c1ff9a6 /gui/src/components/post/Post.tsx | |
| parent | e6e657be3a3b1dae426b46f3bc16f9a5cf4861c2 (diff) | |
Big GUI improvements on Nostr rendering and fetchingpolwex/iris
Diffstat (limited to 'gui/src/components/post/Post.tsx')
| -rw-r--r-- | gui/src/components/post/Post.tsx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gui/src/components/post/Post.tsx b/gui/src/components/post/Post.tsx index 7413e70..9df1993 100644 --- a/gui/src/components/post/Post.tsx +++ b/gui/src/components/post/Post.tsx @@ -9,10 +9,11 @@ import RP from "./RP"; import UserModal from "../modals/UserModal"; import type { Ship } from "@/types/urbit"; import Sigil from "../Sigil"; -import type { UserProfile } from "@/types/nostrill"; +import type { UserProfile, UserType } from "@/types/nostrill"; export interface PostProps { poast: Poast; + user: UserType; fake?: boolean; rter?: Ship; rtat?: number; @@ -52,12 +53,18 @@ function TrillPost(props: PostProps) { const [_, navigate] = useLocation(); function openThread(_e: React.MouseEvent) { const sel = window.getSelection()?.toString(); - if (!sel) navigate(`/feed/${poast.host}/${poast.id}`); + const id = "urbit" in props.user ? poast.id : poast.hash; + const path = `/t/${poast.host}/${id}`; + if (poast.hash.includes("000000")) { + console.log("bad hash", poast); + return; + } + if (!sel) navigate(path); } function openModal(e: React.MouseEvent) { e.stopPropagation(); - setModal(<UserModal userString={poast.author} />); + setModal(<UserModal user={props.user} />); } const avatar = profile ? ( <div className="avatar sigil cp" role="link" onMouseUp={openModal}> |
