fix: public chat copy link button and podcast access

This commit is contained in:
CREDO23 2026-01-26 20:10:03 +02:00
parent ee65e1377f
commit 271de96cce
7 changed files with 47 additions and 20 deletions

View file

@ -355,7 +355,7 @@ export default function NewChatPage() {
hasComments: currentThread?.has_comments ?? false,
addingCommentToMessageId: null,
publicShareEnabled: currentThread?.public_share_enabled ?? false,
publicShareToken: null,
publicShareToken: currentThread?.public_share_token ?? null,
});
}, [currentThread, setCurrentThreadState]);

View file

@ -245,17 +245,24 @@ export function ChatShareButton({ thread, onVisibilityChange, className }: ChatS
</p>
</div>
{isPublicEnabled && publicShareToken && (
<button
type="button"
<div
role="button"
tabIndex={0}
onClick={(e) => {
e.stopPropagation();
handleCopyPublicLink();
}}
className="shrink-0 p-1.5 rounded-md hover:bg-muted transition-colors"
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.stopPropagation();
handleCopyPublicLink();
}
}}
className="shrink-0 p-1.5 rounded-md hover:bg-muted transition-colors cursor-pointer"
title="Copy public link"
>
<Link2 className="size-4 text-muted-foreground" />
</button>
</div>
)}
</button>
</div>

View file

@ -26,7 +26,7 @@ class BaseApiService {
noAuthEndpoints: string[] = ["/auth/jwt/login", "/auth/register", "/auth/refresh"];
// Prefixes that don't require auth (checked with startsWith)
noAuthPrefixes: string[] = ["/api/v1/public/"];
noAuthPrefixes: string[] = ["/api/v1/public/", "/api/v1/podcasts/"];
// Use a getter to always read fresh token from localStorage
// This ensures the token is always up-to-date after login/logout

View file

@ -25,6 +25,7 @@ export interface ThreadRecord {
updated_at: string;
has_comments?: boolean;
public_share_enabled?: boolean;
public_share_token?: string | null;
}
export interface MessageRecord {