fix: use backend covers for recommendations
This commit is contained in:
@@ -40,10 +40,9 @@ export function RecommendedCard({
|
|||||||
visualIndex % officialRecommendationCoverFallbacks.length
|
visualIndex % officialRecommendationCoverFallbacks.length
|
||||||
];
|
];
|
||||||
const cover = useMemo(() => {
|
const cover = useMemo(() => {
|
||||||
if (useFigmaDesign) return figmaCover;
|
|
||||||
const original = r.coverImage || r.previewUrl;
|
const original = r.coverImage || r.previewUrl;
|
||||||
if (isPlaceholderAsset(original)) {
|
if (isPlaceholderAsset(original)) {
|
||||||
return figmaCover;
|
return useFigmaDesign ? "" : figmaCover;
|
||||||
}
|
}
|
||||||
return assetUrl(original);
|
return assetUrl(original);
|
||||||
}, [figmaCover, r.coverImage, r.previewUrl, useFigmaDesign]);
|
}, [figmaCover, r.coverImage, r.previewUrl, useFigmaDesign]);
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ function inferType(post: Post, att: Attachment | undefined): string {
|
|||||||
|
|
||||||
function coverFor(att: Attachment | undefined) {
|
function coverFor(att: Attachment | undefined) {
|
||||||
if (!att) return "";
|
if (!att) return "";
|
||||||
if (att.kind === "image") return att.thumbnailUrl || att.url;
|
if (att.kind === "image" || att.mime.startsWith("image/")) {
|
||||||
if (att.kind === "video") return att.posterUrl || att.thumbnailUrl || "";
|
return att.thumbnailUrl || att.url;
|
||||||
if (att.mime.startsWith("image/")) return att.thumbnailUrl || att.url;
|
}
|
||||||
return "";
|
return att.posterUrl || att.thumbnailUrl || "";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function postToResource(
|
export function postToResource(
|
||||||
|
|||||||
Reference in New Issue
Block a user