update to svelte 5
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
<script lang="ts">
|
||||
import type { Account } from '$lib/mastodon/response';
|
||||
|
||||
export let account: Account;
|
||||
let avatarDescription: string;
|
||||
let sourceSetHtml: string;
|
||||
$: avatarDescription = `Avatar for ${account.acct}`;
|
||||
$: {
|
||||
interface Props {
|
||||
account: Account;
|
||||
}
|
||||
|
||||
let { account }: Props = $props();
|
||||
let avatarDescription: string = $derived(`Avatar for ${account.acct}`);
|
||||
let sourceSetHtml: string = $derived.by(() => {
|
||||
// Sort thumbnails by file type. This is important, because the order of the srcset entries matter.
|
||||
// We need the best format to be first
|
||||
const formatPriority = new Map<string, number>([
|
||||
@ -33,8 +35,8 @@
|
||||
const srcset = entry[1].join(', ');
|
||||
html += `<source srcset="${srcset}" type="${entry[0]}" />`;
|
||||
}
|
||||
sourceSetHtml = html;
|
||||
}
|
||||
return html;
|
||||
});
|
||||
</script>
|
||||
|
||||
<picture>
|
||||
|
Reference in New Issue
Block a user