upd: add option for reply depth

This commit is contained in:
ShittyKopper 2023-12-07 16:54:31 +03:00 committed by dakkar
parent 107cbac914
commit 05166f79e1
8 changed files with 23 additions and 4 deletions

View file

@ -64,7 +64,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</footer>
</div>
</div>
<template v-if="depth < 5">
<template v-if="depth < numberOfReplies">
<MkNoteSub v-for="reply in replies" :key="reply.id" :note="reply" :class="$style.reply" :detail="true" :depth="depth + 1" :expandAllCws="props.expandAllCws"/>
</template>
<div v-else :class="$style.more">
@ -124,6 +124,7 @@ const translation = ref<any>(null);
const translating = ref(false);
const isDeleted = ref(false);
const renoted = ref(false);
const numberOfReplies = ref(defaultStore.state.numberOfReplies);
const reactButton = shallowRef<HTMLElement>();
const renoteButton = shallowRef<HTMLElement>();
const quoteButton = shallowRef<HTMLElement>();
@ -390,7 +391,7 @@ function menu(viaKeyboard = false): void {
if (props.detail) {
os.api('notes/children', {
noteId: props.note.id,
limit: 5,
limit: numberOfReplies.value,
showQuotes: false,
}).then(res => {
replies = res;