fix: sort options not working on user
This commit is contained in:
2 files changed
+18
-10
No files matched your search
@@ -1,11 +1,11 @@
|
|||||||
<div class="skeleton animate-pulse flex flex-col gap-2 w-full">
|
<div class="skeleton animate-pulse flex flex-col gap-2 w-full">
|
||||||
<div
|
<div
|
||||||
class="w-2/3 h-6 bg-slate-300 dark:bg-zinc-700 animate-pulse rounded-md"
|
class="w-2/3 h-6 bg-slate-300 dark:bg-zinc-800 animate-pulse rounded-md"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
class="w-full h-20 bg-slate-300 dark:bg-zinc-700 animate-pulse rounded-md"
|
class="w-full h-20 bg-slate-300 dark:bg-zinc-800 animate-pulse rounded-md"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
class="w-32 h-6 bg-slate-300 dark:bg-zinc-700 animate-pulse rounded-md"
|
class="w-32 h-6 bg-slate-300 dark:bg-zinc-800 animate-pulse rounded-md"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { run } from 'svelte/legacy'
|
|
||||||
|
|
||||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||||
import {
|
import {
|
||||||
AdjustmentsHorizontal,
|
AdjustmentsHorizontal,
|
||||||
@@ -46,9 +44,12 @@
|
|||||||
inline?: boolean
|
inline?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
let { data = $bindable(), inline = false }: Props = $props()
|
let { data: pageData, inline = false }: Props = $props()
|
||||||
|
|
||||||
|
let data = $state(pageData)
|
||||||
|
|
||||||
let blocking = false
|
let blocking = false
|
||||||
|
let sortForm = $state<HTMLFormElement>()
|
||||||
|
|
||||||
async function blockUser(block: number) {
|
async function blockUser(block: number) {
|
||||||
if (!profile.data?.user || !profile.data?.jwt)
|
if (!profile.data?.user || !profile.data?.jwt)
|
||||||
@@ -91,7 +92,7 @@
|
|||||||
|
|
||||||
let purgingUser = $state(false)
|
let purgingUser = $state(false)
|
||||||
let purgeEnabled = $state(false)
|
let purgeEnabled = $state(false)
|
||||||
run(() => {
|
$effect(() => {
|
||||||
if (purgingUser) {
|
if (purgingUser) {
|
||||||
purgeEnabled = false
|
purgeEnabled = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -295,10 +296,16 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||||
<form action={page.url.} class="flex flex-row gap-4 flex-wrap">
|
<form
|
||||||
|
action={page.url.origin + page.url.pathname}
|
||||||
|
method="GET"
|
||||||
|
class="flex flex-row gap-4 flex-wrap"
|
||||||
|
bind:this={sortForm}
|
||||||
|
>
|
||||||
<Select
|
<Select
|
||||||
bind:value={data.type}
|
bind:value={data.type}
|
||||||
onchange={() => searchParam(page.url, 'type', data.type, 'page')}
|
name="type"
|
||||||
|
onchange={() => sortForm?.requestSubmit()}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
@@ -312,7 +319,8 @@
|
|||||||
</Select>
|
</Select>
|
||||||
<Select
|
<Select
|
||||||
bind:value={data.sort}
|
bind:value={data.sort}
|
||||||
onchange={() => searchParam(page.url, 'sort', data.sort, 'page')}
|
name="sort"
|
||||||
|
onchange={() => sortForm?.requestSubmit()}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
|
|||||||
Reference in new issue
Block a user