a tool for shared writing and social publishing

add proper route to redirect on pub login in comments

+8 -5
+8 -5
app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
··· 29 29 return [...localComments, ...props.comments]; 30 30 }, [props.comments, localComments]); 31 31 let pathname = usePathname(); 32 + let redirectRoute = useMemo(() => { 33 + let url = new URL(pathname, window.location.origin); 34 + url.searchParams.set("refreshAuth", ""); 35 + url.searchParams.set("interactionDrawer", "comments"); 36 + url.hash = "commentsDrawer"; 37 + return url.toString(); 38 + }, []); 32 39 33 40 return ( 34 41 <div id={"commentsDrawer"} className="flex flex-col gap-2 relative"> ··· 46 53 ) : ( 47 54 <div className="w-full accent-container text-tertiary text-center italic p-3 flex flex-col gap-2"> 48 55 Connect a Bluesky account to comment 49 - <BlueskyLogin 50 - redirectRoute={ 51 - pathname + "?interactionDrawer=comments#commentsDrawer" 52 - } 53 - /> 56 + <BlueskyLogin redirectRoute={redirectRoute} /> 54 57 </div> 55 58 )} 56 59 <hr className="border-border-light" />