mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-18 19:23:40 +00:00
Reverse reply sort order, move more replies button to top of replies
This commit is contained in:
parent
fb3426e80e
commit
3d095e83ef
@ -182,14 +182,15 @@
|
||||
{/if}
|
||||
|
||||
{#if depth > 0}
|
||||
{#each note.replies as r (r.id)}
|
||||
<div class="ml-5 border-l border-solid border-medium">
|
||||
{#if note.repliesCount > 3 && note.replies.length < note.repliesCount}
|
||||
<div class="ml-5 py-2 text-light cursor-pointer" on:click={onClick}>
|
||||
<i class="fa-solid fa-up-down text-sm pr-2" />
|
||||
Show {quantify(note.repliesCount - note.replies.length, 'other reply', 'more replies')}
|
||||
</div>
|
||||
{/if}
|
||||
{#each note.replies as r (r.id)}
|
||||
<svelte:self showParent={false} note={r} depth={depth - 1} {invertColors} {anchorId} />
|
||||
</div>
|
||||
{/each}
|
||||
{#if note.repliesCount > 5 && note.replies.length < note.repliesCount}
|
||||
<div class="ml-10 mt-2 text-light cursor-pointer" on:click={onClick}>
|
||||
{quantify(note.repliesCount - note.replies.length, 'more reply', 'more replies')} found.
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
@ -102,8 +102,8 @@ const findNote = async (id, {showEntire = false, depth = 1} = {}) => {
|
||||
replies: depth === 0
|
||||
? []
|
||||
: await Promise.all(
|
||||
sortBy(e => -e.created_at, replies)
|
||||
.slice(0, showEntire ? Infinity : 3)
|
||||
sortBy(e => e.created_at, replies)
|
||||
.slice(showEntire ? 0 : -3)
|
||||
.map(r => findNote(r.id, {depth: depth - 1}))
|
||||
),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user