fix: make PostListShell params reactive, close #681
This commit is contained in:
1 file changed
+10
-5
@@ -47,7 +47,12 @@
|
|||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
|
|
||||||
$effect(() => {
|
$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(
|
const FeedComponent = $derived(
|
||||||
@@ -67,15 +72,15 @@
|
|||||||
{@render passedExtended?.()}
|
{@render passedExtended?.()}
|
||||||
<form class="" method="get" action={page.url.pathname}>
|
<form class="" method="get" action={page.url.pathname}>
|
||||||
<div class="flex flex-row gap-2">
|
<div class="flex flex-row gap-2">
|
||||||
{#if params.location}
|
{#if filters.location}
|
||||||
<Location name="type" navigate bind:selected={params.location} />
|
<Location name="type" navigate bind:selected={filters.location} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if params.sort}
|
{#if filters.sort}
|
||||||
<Sort
|
<Sort
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
name="sort"
|
name="sort"
|
||||||
navigate
|
navigate
|
||||||
bind:selected={params.sort}
|
bind:selected={filters.sort}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<ViewSelect placement="bottom" />
|
<ViewSelect placement="bottom" />
|
||||||
|
|||||||
Reference in new issue
Block a user