This commit is contained in:
Christbru 2025-10-19 11:35:28 -05:00
commit 95ce7b343c
4 changed files with 20 additions and 4 deletions

View file

@ -67,7 +67,10 @@ export default function ChatLayout() {
.filter((f) => f && typeof f === "object")
.map((file) => {
const filename = file.filename || file.id || "download";
const linkTarget = `/storage/${encodeURIComponent(filename)}`;
const storageUrl = file.storage_url || `/storage/${filename}`;
const linkTarget = storageUrl.startsWith("/storage/")
? `/storage/${encodeURIComponent(storageUrl.replace("/storage/", ""))}`
: storageUrl;
const description = file.description?.trim();
const score =
typeof file.score === "number"