diff --git a/src/app/page.tsx b/src/app/page.tsx index 97ba183..544cc8f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -25,6 +25,7 @@ export default function Home() { const [replyingTo, setReplyingTo] = useState(null); const [feedType, setFeedType] = useState<'latest' | 'curated'>('latest'); const [isNsfwNode, setIsNsfwNode] = useState(false); + const [nodeInfoLoaded, setNodeInfoLoaded] = useState(false); const [feedMeta, setFeedMeta] = useState<{ algorithm: string; windowHours: number; @@ -43,8 +44,11 @@ export default function Home() { .then(res => res.json()) .then(data => { setIsNsfwNode(data.isNsfw || false); + setNodeInfoLoaded(true); }) - .catch(() => {}); + .catch(() => { + setNodeInfoLoaded(true); + }); }, []); const loadFeed = async (type: 'latest' | 'curated') => { @@ -171,7 +175,11 @@ export default function Home() { )} {/* NSFW node gate for unauthenticated users */} - {!user && isNsfwNode ? ( + {!user && !nodeInfoLoaded ? ( +
+ Loading... +
+ ) : !user && isNsfwNode ? (

diff --git a/src/components/Compose.tsx b/src/components/Compose.tsx index 9f509c4..5e0e35b 100644 --- a/src/components/Compose.tsx +++ b/src/components/Compose.tsx @@ -31,7 +31,7 @@ export function Compose({ onPost, replyingTo, onCancelReply, placeholder = "What const [isNsfw, setIsNsfw] = useState(false); const [canPostNsfw, setCanPostNsfw] = useState(false); const [isNsfwNode, setIsNsfwNode] = useState(false); - const maxLength = 400; + const maxLength = 600; const remaining = maxLength - content.length; // Check if user can post NSFW content and if node is NSFW diff --git a/src/components/PostCard.tsx b/src/components/PostCard.tsx index 4b22ed6..8c79450 100644 --- a/src/components/PostCard.tsx +++ b/src/components/PostCard.tsx @@ -244,6 +244,21 @@ export function PostCard({ post, onLike, onRepost, onComment, onDelete, onHide, const postUrl = `/${post.author.handle}/posts/${post.id}`; + // Get the full handle for profile links (includes domain for remote users) + const getProfileHandle = () => { + // If handle already has domain, use it + if (post.author.handle.includes('@')) { + return post.author.handle; + } + // If this is a swarm post, append the node domain + if (post.nodeDomain) { + return `${post.author.handle}@${post.nodeDomain}`; + } + // Local user + return post.author.handle; + }; + const profileHandle = getProfileHandle(); + // Decode HTML entities from federated posts (e.g., &rsquo; -> ') const decodeHtmlEntities = (text: string): string => { const entities: Record = { @@ -346,7 +361,7 @@ export function PostCard({ post, onLike, onRepost, onComment, onDelete, onHide, {!isDetail && }

- e.stopPropagation()}> + e.stopPropagation()}>
{post.author.avatarUrl ? ( {post.author.displayName} @@ -357,7 +372,7 @@ export function PostCard({ post, onLike, onRepost, onComment, onDelete, onHide,
- e.stopPropagation()}> + e.stopPropagation()}> {post.author.displayName || post.author.handle} {post.bot && (