migrate: switch run() to $effect
This commit is contained in:
1 parent
1b4bb96003
commit
c75e0cc4b7
4 files changed
+16
-11
No files matched your search
@@ -177,15 +177,15 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onMount(async () => {
|
// onMount(async () => {
|
||||||
await tick()
|
// await tick()
|
||||||
$virtualizer.measure()
|
// $virtualizer.measure()
|
||||||
})
|
// })
|
||||||
|
|
||||||
let items = $derived($virtualizer.getVirtualItems())
|
let items = $derived($virtualizer.getVirtualItems())
|
||||||
run(() => {
|
$effect(() => {
|
||||||
if (virtualItemEls.length) {
|
if (virtualItemEls.length)
|
||||||
virtualItemEls.forEach($virtualizer.measureElement)
|
virtualItemEls.forEach($virtualizer.measureElement)
|
||||||
}
|
|
||||||
})
|
})
|
||||||
run(() => {
|
run(() => {
|
||||||
if (posts.length && virtualListEl)
|
if (posts.length && virtualListEl)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
? '!bg-slate-100 dark:!bg-zinc-900'
|
? '!bg-slate-100 dark:!bg-zinc-900'
|
||||||
: ''}"
|
: ''}"
|
||||||
>
|
>
|
||||||
{#snippet icon()}
|
{#snippet customIcon()}
|
||||||
<ProfileAvatar
|
<ProfileAvatar
|
||||||
profile={prof}
|
profile={prof}
|
||||||
{index}
|
{index}
|
||||||
|
|||||||
@@ -47,7 +47,9 @@
|
|||||||
: ''} {clazz}"
|
: ''} {clazz}"
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
{#if customIcon}{@render customIcon({ selected })}{:else if icon}
|
{#if customIcon}
|
||||||
|
{@render customIcon({ selected })}
|
||||||
|
{:else if icon}
|
||||||
<Icon src={icon} solid={selected} size="20" />
|
<Icon src={icon} solid={selected} size="20" />
|
||||||
{/if}
|
{/if}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
let sort = $state(data.sort)
|
let sort = $state(data.sort)
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
|
if (type) settings.defaultSort.feed = type
|
||||||
if (sort) settings.defaultSort.sort = sort
|
if (sort) settings.defaultSort.sort = sort
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -39,8 +40,10 @@
|
|||||||
|
|
||||||
{#snippet extended()}
|
{#snippet extended()}
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<Location bind:selected={type} />
|
{#if type}
|
||||||
<Sort bind:selected={sort} />
|
<Location navigate bind:selected={type} />
|
||||||
|
{/if}
|
||||||
|
<Sort navigate bind:selected={sort} />
|
||||||
<ViewSelect />
|
<ViewSelect />
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
Reference in new issue
Block a user