707398b1d9
* fix and enhance MkNoteDetailed * change instanceticker * 🎨 * fix * 🎨 * fix * 🎨 * revert MkNoteDetailed
14 lines
456 B
TypeScript
14 lines
456 B
TypeScript
import { query } from '@/scripts/url';
|
|
import { url } from '@/config';
|
|
|
|
export function getProxiedImageUrl(imageUrl: string, type?: 'preview'): string {
|
|
return `${url}/proxy/image.webp?${query({
|
|
url: imageUrl,
|
|
...(type ? { [type]: "1" } : {}),
|
|
})}`;
|
|
}
|
|
|
|
export function getProxiedImageUrlNullable(imageUrl: string | null | undefined, type?: 'preview'): string | null {
|
|
if (imageUrl == null) return null;
|
|
return getProxiedImageUrl(imageUrl, type);
|
|
}
|