From 0bd4bf182c77b9e64e40e6eee6bfbd276f36d5c1 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Sun, 31 Aug 2025 23:31:16 -0700 Subject: [PATCH] Show shared chats without login popup shown to unauthenticated users The login popup is an unnecessary distraction as you do not need to be logged in to view shared chats. --- .../web/app/components/appSidebar/appSidebar.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/interface/web/app/components/appSidebar/appSidebar.tsx b/src/interface/web/app/components/appSidebar/appSidebar.tsx index 94b3b3ea..6af5f4f5 100644 --- a/src/interface/web/app/components/appSidebar/appSidebar.tsx +++ b/src/interface/web/app/components/appSidebar/appSidebar.tsx @@ -26,6 +26,7 @@ import { useIsDarkMode, useIsMobileWidth } from "@/app/common/utils"; import { UserPlusIcon } from "lucide-react"; import { useAuthenticatedData, UserProfile } from "@/app/common/auth"; import LoginPrompt from "../loginPrompt/loginPrompt"; +import { usePathname } from "next/navigation"; async function openChat(userData: UserProfile | null | undefined) { const unauthenticatedRedirectUrl = `/login?redirect=${encodeURIComponent(window.location.pathname)}`; @@ -88,17 +89,21 @@ interface AppSidebarProps { export function AppSidebar(props: AppSidebarProps) { const isMobileWidth = useIsMobileWidth(); const { data, isLoading, error } = useAuthenticatedData(); + const pathname = usePathname(); const { state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar } = useSidebar(); const [showLoginPrompt, setShowLoginPrompt] = useState(false); + // Check if we're on a shared chat page + const isSharedChatPage = pathname?.startsWith("/share/chat"); + useEffect(() => { - if (!isLoading && !data) { + if (!isLoading && !data && !isSharedChatPage) { setShowLoginPrompt(true); } - }, [isLoading, data]); + }, [isLoading, data, isSharedChatPage]); return (