fix: make PostListShell params reactive, close #681

This commit is contained in:
Xylight committed 2025-11-09 09:38:46 -08:00
1 parent e3a3479f67
commit c6c7d74ed3
1 file changed
+10 -5
+10 -5
View File
@@ -47,7 +47,12 @@
}: Props = $props()
$effect(() => {
if (params.sort) settings.defaultSort.sort = params.sort
if (filters.sort) settings.defaultSort.sort = filters.sort
})
let filters = $state({
location: params.location,
sort: params.sort,
})
const FeedComponent = $derived(
@@ -67,15 +72,15 @@
{@render passedExtended?.()}
<form class="" method="get" action={page.url.pathname}>
<div class="flex flex-row gap-2">
{#if params.location}
<Location name="type" navigate bind:selected={params.location} />
{#if filters.location}
<Location name="type" navigate bind:selected={filters.location} />
{/if}
{#if params.sort}
{#if filters.sort}
<Sort
placement="bottom"
name="sort"
navigate
bind:selected={params.sort}
bind:selected={filters.sort}
/>
{/if}
<ViewSelect placement="bottom" />