feat: polish message attachment downloads

This commit is contained in:
TerryM
2026-05-26 18:04:36 +08:00
parent e0629c9df7
commit 532f0112fd
8 changed files with 274 additions and 59 deletions

View File

@@ -6,6 +6,7 @@ import { useI18n } from "../i18n";
import { useMemo } from "react";
import { formatDateYmd } from "../utils/format";
import { officialRecommendationCoverFallbacks } from "./FigmaBanner";
import { downloadFile } from "./messageStream/utils/downloadFile";
function isPlaceholderAsset(path: string | undefined | null) {
return !path || path.includes("placeholder-cover");
@@ -98,7 +99,7 @@ export function RecommendedCard({
} catch {
/* ignore */
}
window.open(dl, "_blank", "noopener,noreferrer");
void downloadFile(dl, r.title).catch(() => {});
}}
>
<Download className="h-5 w-5" strokeWidth={2.2} />