fix "number of replies"

This commit is contained in:
dakkar 2025-05-09 09:30:45 +01:00
parent 9d5e477c9d
commit 51a07fc6e4
2 changed files with 8 additions and 10 deletions

View file

@ -65,7 +65,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</footer> </footer>
</div> </div>
</div> </div>
<template v-if="depth < store.s.numberOfReplies"> <template v-if="depth < prefer.s.numberOfReplies">
<MkNoteSub v-for="reply in replies" :key="reply.id" :note="reply" :class="$style.reply" :detail="true" :depth="depth + 1" :expandAllCws="props.expandAllCws" :onDeleteCallback="removeReply"/> <MkNoteSub v-for="reply in replies" :key="reply.id" :note="reply" :class="$style.reply" :detail="true" :depth="depth + 1" :expandAllCws="props.expandAllCws" :onDeleteCallback="removeReply"/>
</template> </template>
<div v-else :class="$style.more"> <div v-else :class="$style.more">
@ -111,7 +111,6 @@ import { getNoteMenu } from '@/utility/get-note-menu.js';
import { boostMenuItems, computeRenoteTooltip } from '@/utility/boost-quote.js'; import { boostMenuItems, computeRenoteTooltip } from '@/utility/boost-quote.js';
import { prefer } from '@/preferences.js'; import { prefer } from '@/preferences.js';
import { useNoteCapture } from '@/use/use-note-capture.js'; import { useNoteCapture } from '@/use/use-note-capture.js';
import { store } from '@/store.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
note: Misskey.entities.Note; note: Misskey.entities.Note;
@ -178,8 +177,8 @@ useNoteCapture({
note: appearNote, note: appearNote,
isDeletedRef: isDeleted, isDeletedRef: isDeleted,
// only update replies if we are, in fact, showing replies // only update replies if we are, in fact, showing replies
onReplyCallback: props.detail && props.depth < store.s.numberOfReplies ? addReplyTo : undefined, onReplyCallback: props.detail && props.depth < prefer.s.numberOfReplies ? addReplyTo : undefined,
onDeleteCallback: props.detail && props.depth < store.s.numberOfReplies ? props.onDeleteCallback : undefined, onDeleteCallback: props.detail && props.depth < prefer.s.numberOfReplies ? props.onDeleteCallback : undefined,
}); });
if ($i) { if ($i) {
@ -384,7 +383,7 @@ function menu(): void {
if (props.detail) { if (props.detail) {
misskeyApi('notes/children', { misskeyApi('notes/children', {
noteId: props.note.id, noteId: props.note.id,
limit: store.s.numberOfReplies, limit: prefer.s.numberOfReplies,
showQuotes: false, showQuotes: false,
}).then(res => { }).then(res => {
replies.value = res; replies.value = res;

View file

@ -73,7 +73,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</footer> </footer>
</div> </div>
</div> </div>
<template v-if="depth < store.s.numberOfReplies"> <template v-if="depth < prefer.s.numberOfReplies">
<SkNoteSub v-for="reply in replies" :key="reply.id" :note="reply" :class="[$style.reply, { [$style.single]: replies.length === 1 }]" :detail="true" :depth="depth + 1" :expandAllCws="props.expandAllCws" :onDeleteCallback="removeReply" :isReply="props.isReply"/> <SkNoteSub v-for="reply in replies" :key="reply.id" :note="reply" :class="[$style.reply, { [$style.single]: replies.length === 1 }]" :detail="true" :depth="depth + 1" :expandAllCws="props.expandAllCws" :onDeleteCallback="removeReply" :isReply="props.isReply"/>
</template> </template>
<div v-else :class="$style.more"> <div v-else :class="$style.more">
@ -119,7 +119,6 @@ import { getNoteMenu } from '@/utility/get-note-menu.js';
import { boostMenuItems, computeRenoteTooltip } from '@/utility/boost-quote.js'; import { boostMenuItems, computeRenoteTooltip } from '@/utility/boost-quote.js';
import { prefer } from '@/preferences.js'; import { prefer } from '@/preferences.js';
import { useNoteCapture } from '@/use/use-note-capture.js'; import { useNoteCapture } from '@/use/use-note-capture.js';
import { store } from '@/store.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
note: Misskey.entities.Note; note: Misskey.entities.Note;
@ -192,8 +191,8 @@ useNoteCapture({
note: appearNote, note: appearNote,
isDeletedRef: isDeleted, isDeletedRef: isDeleted,
// only update replies if we are, in fact, showing replies // only update replies if we are, in fact, showing replies
onReplyCallback: props.detail && props.depth < store.s.numberOfReplies ? addReplyTo : undefined, onReplyCallback: props.detail && props.depth < prefer.s.numberOfReplies ? addReplyTo : undefined,
onDeleteCallback: props.detail && props.depth < store.s.numberOfReplies ? props.onDeleteCallback : undefined, onDeleteCallback: props.detail && props.depth < prefer.s.numberOfReplies ? props.onDeleteCallback : undefined,
}); });
if ($i) { if ($i) {
@ -398,7 +397,7 @@ function menu(): void {
if (props.detail) { if (props.detail) {
misskeyApi('notes/children', { misskeyApi('notes/children', {
noteId: props.note.id, noteId: props.note.id,
limit: store.s.numberOfReplies, limit: prefer.s.numberOfReplies,
showQuotes: false, showQuotes: false,
}).then(res => { }).then(res => {
replies.value = res; replies.value = res;