From dea8945e43ed56c87fa3a35242f0c6874bf2ffab Mon Sep 17 00:00:00 2001 From: soxa <6390896+Soxasora@users.noreply.github.com> Date: Sat, 9 Aug 2025 22:14:29 +0200 Subject: [PATCH] fix wrong URL on Reply on another page (#2410) * fix wrong URL on Reply on another page * better naming and explanation for bottomed out comments --- components/comment.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/comment.js b/components/comment.js index a060dd0d..3f77225d 100644 --- a/components/comment.js +++ b/components/comment.js @@ -280,7 +280,7 @@ export default function Comment ({ {collapse !== 'yep' && ( bottomedOut - ?
+ ?
: (
{item.outlawed && !me?.privates?.wildWestMode @@ -314,13 +314,15 @@ export default function Comment ({ ) } -export function ViewMoreReplies ({ item, navigateRoot = false }) { +export function ViewMoreReplies ({ item, threadContext = false }) { const root = useRoot() - const id = navigateRoot ? commentSubTreeRootId(item, root) : item.id + const id = threadContext ? commentSubTreeRootId(item, root) : item.id - const href = `/items/${id}` + (navigateRoot ? '' : `?commentId=${item.id}`) + // if threadContext is true, we travel to some comments before the current comment, focusing on the comment itself + // otherwise, we directly navigate to the comment + const href = `/items/${id}` + (threadContext ? `?commentId=${item.id}` : '') - const text = navigateRoot && item.ncomments === 0 + const text = threadContext && item.ncomments === 0 ? 'reply on another page' : `view all ${item.ncomments} replies`