From 4005d88804b5650fdecd1ce7c1a7499410c30411 Mon Sep 17 00:00:00 2001 From: plebbitor Date: Sat, 18 Mar 2023 22:05:46 +0100 Subject: [PATCH] fix loading replyCount --- src/components/Thread.jsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/Thread.jsx b/src/components/Thread.jsx index e442cf15..28ccfd3c 100644 --- a/src/components/Thread.jsx +++ b/src/components/Thread.jsx @@ -534,12 +534,22 @@ const Thread = ({ setBodyStyle }) => { event.target.style.cursor='pointer'} onTouchStart={handleClickBottom}>Bottom ] + {/* "loading" indicator while replycount loads */} {comment ? ( - comment.replyCount > 0 ? ( - {comment.replyCount} replies + comment.replyCount !== undefined ? ( + comment.replyCount > 0 ? ( + comment.replyCount === 1 ? ( + {comment.replyCount} reply + ) : ( + {comment.replyCount} replies + ) + ) : ( + No replies yet + ) ) : ( - No replies yet - )) : ( + Loading... + ) + ) : ( null )}