a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

don't render bluesky dates on initial page load

+13 -9
+13 -9
components/Blocks/BlueskyPostBlock/index.tsx
··· 12 12 import { BlueskyRichText } from "./BlueskyRichText"; 13 13 import { Separator } from "components/Layout"; 14 14 import { PostView } from "@atproto/api/dist/client/types/app/bsky/feed/defs"; 15 + import { useInitialPageLoad } from "components/InitialPageLoadProvider"; 15 16 16 17 export const BlueskyPostBlock = (props: BlockProps & { preview?: boolean }) => { 17 18 let { permissions } = useEntitySetContext(); ··· 27 28 input?.focus(); 28 29 } else input?.blur(); 29 30 }, [isSelected, props.entityID, props.preview]); 31 + 32 + let initialPageLoad = useInitialPageLoad(); 30 33 31 34 switch (true) { 32 35 case !post: ··· 79 82 let postId = post.post.uri.split("/")[4]; 80 83 let url = `https://bsky.app/profile/${post.post.author.handle}/post/${postId}`; 81 84 82 - let datetime = new Date(timestamp ? timestamp : ""); 83 - let datetimeFormatted = datetime.toLocaleString("en-US", { 84 - month: "short", 85 - day: "numeric", 86 - year: "numeric", 87 - hour: "numeric", 88 - minute: "numeric", 89 - hour12: true, 90 - }); 85 + let datetimeFormatted = initialPageLoad 86 + ? new Date(timestamp ? timestamp : "").toLocaleString("en-US", { 87 + month: "short", 88 + day: "numeric", 89 + year: "numeric", 90 + hour: "numeric", 91 + minute: "numeric", 92 + hour12: true, 93 + }) 94 + : ""; 91 95 92 96 return ( 93 97 <div