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,
|
limit: 25,
|
||||||
type_: 'All',
|
type_: 'All',
|
||||||
post_id: data.post.value.post_view.post.id,
|
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,
|
max_depth: data.post.value.post_view.counts.comments > 100 ? 1 : 3,
|
||||||
})
|
})
|
||||||
loading = false
|
loading = false
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.svelte'
|
import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.svelte'
|
||||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
|
import { settings } from '$lib/settings.svelte'
|
||||||
import type {
|
import type {
|
||||||
CommentSortType,
|
CommentSortType,
|
||||||
GetCommentsResponse,
|
GetCommentsResponse,
|
||||||
@@ -72,7 +73,11 @@
|
|||||||
|
|
||||||
{#snippet action()}
|
{#snippet action()}
|
||||||
<div class="gap-2 flex items-center">
|
<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={Fire} value="Hot">{$t('filter.sort.hot')}</Option>
|
||||||
<Option icon={Trophy} value="Top">
|
<Option icon={Trophy} value="Top">
|
||||||
{$t('filter.sort.top.label')}
|
{$t('filter.sort.top.label')}
|
||||||
@@ -116,7 +121,11 @@
|
|||||||
|
|
||||||
{#if commenting || !profile.data.jwt}
|
{#if commenting || !profile.data.jwt}
|
||||||
<div class="gap-2 flex items-center">
|
<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={Fire} value="Hot">{$t('filter.sort.hot')}</Option>
|
||||||
<Option icon={Trophy} value="Top">
|
<Option icon={Trophy} value="Top">
|
||||||
{$t('filter.sort.top.label')}
|
{$t('filter.sort.top.label')}
|
||||||
|
|||||||
Reference in new issue
Block a user