fix: switch to settings default sort for comments
This commit is contained in:
2 files changed
+12
-3
No files matched your search
@@ -62,7 +62,7 @@
|
||||
limit: 25,
|
||||
type_: 'All',
|
||||
post_id: data.post.value.post_view.post.id,
|
||||
sort: data.commentSort.value,
|
||||
sort: settings.defaultSort.comments,
|
||||
max_depth: data.post.value.post_view.counts.comments > 100 ? 1 : 3,
|
||||
})
|
||||
loading = false
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.svelte'
|
||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type {
|
||||
CommentSortType,
|
||||
GetCommentsResponse,
|
||||
@@ -72,7 +73,11 @@
|
||||
|
||||
{#snippet action()}
|
||||
<div class="gap-2 flex items-center">
|
||||
<Select size="md" bind:value={sort} onchange={onupdate}>
|
||||
<Select
|
||||
size="md"
|
||||
bind:value={settings.defaultSort.comments}
|
||||
onchange={onupdate}
|
||||
>
|
||||
<Option icon={Fire} value="Hot">{$t('filter.sort.hot')}</Option>
|
||||
<Option icon={Trophy} value="Top">
|
||||
{$t('filter.sort.top.label')}
|
||||
@@ -116,7 +121,11 @@
|
||||
|
||||
{#if commenting || !profile.data.jwt}
|
||||
<div class="gap-2 flex items-center">
|
||||
<Select size="md" bind:value={sort} onchange={onupdate}>
|
||||
<Select
|
||||
size="md"
|
||||
bind:value={settings.defaultSort.comments}
|
||||
onchange={onupdate}
|
||||
>
|
||||
<Option icon={Fire} value="Hot">{$t('filter.sort.hot')}</Option>
|
||||
<Option icon={Trophy} value="Top">
|
||||
{$t('filter.sort.top.label')}
|
||||
|
||||
Reference in new issue
Block a user