From f8674963b3cd36b77f0486574f72ec2feaef1628 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 4 Nov 2023 18:02:03 +0800 Subject: [PATCH] Prevent the extra call if posts = 0 --- src/components/account-info.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index af098fd3..ceea422a 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -304,12 +304,13 @@ function AccountInfo({ ({ relationship, currentID }) => { if (!relationship.following) { renderFamiliarFollowers(currentID); - if (!standalone) { + if (!standalone && statusesCount > 0) { + // Only render posting stats if not standalone and has posts renderPostingStats(); } } }, - [standalone, id], + [standalone, id, statusesCount], ); return (