Skip to content

Commit 9ab49a7

Browse files
committed
use primal cdn for images
1 parent 4d3ecdc commit 9ab49a7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/routes/Search.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,16 @@ function ContactButton(props: {
465465
onClick: () => void;
466466
}) {
467467
const i18n = useI18n();
468+
469+
const primalUrl = createMemo(() => {
470+
const originalUrl = props.contact.image_url;
471+
if (!originalUrl) return undefined;
472+
473+
return `https://primal.b-cdn.net/media-cache?s=s&a=1&u=${encodeURIComponent(
474+
originalUrl
475+
)}`;
476+
});
477+
468478
return (
469479
<button
470480
onClick={() => props.onClick()}
@@ -480,7 +490,7 @@ function ContactButton(props: {
480490
>
481491
<LabelCircle
482492
name={props.contact.name}
483-
image_url={props.contact.image_url}
493+
image_url={primalUrl()}
484494
contact
485495
label={false}
486496
/>

0 commit comments

Comments
 (0)