From dafff4b63502548f537b60f43d7df226a3d9c3c2 Mon Sep 17 00:00:00 2001
From: Lim Chee Aun <cheeaun@gmail.com>
Date: Sat, 16 Sep 2023 23:42:49 +0800
Subject: [PATCH] Show remaining count if exceed the avatars limit

---
 src/components/notification.jsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/components/notification.jsx b/src/components/notification.jsx
index 6467eb68..e0e2e5e8 100644
--- a/src/components/notification.jsx
+++ b/src/components/notification.jsx
@@ -61,6 +61,8 @@ const contentText = {
   'admin.report': 'reported a post.',
 };
 
+const AVATARS_LIMIT = 50;
+
 function Notification({ notification, instance, reload, isStatic }) {
   const { id, status, account, _accounts, _statuses } = notification;
   let { type } = notification;
@@ -207,7 +209,7 @@ function Notification({ notification, instance, reload, isStatic }) {
         )}
         {_accounts?.length > 1 && (
           <p class="avatars-stack">
-            {_accounts.slice(0, 50).map((account, i) => (
+            {_accounts.slice(0, AVATARS_LIMIT).map((account, i) => (
               <>
                 <a
                   href={account.url}
@@ -254,6 +256,8 @@ function Notification({ notification, instance, reload, isStatic }) {
               class="small plain"
               onClick={handleOpenGenericAccounts}
             >
+              {_accounts.length > AVATARS_LIMIT &&
+                `+${_accounts.length - AVATARS_LIMIT}`}
               <Icon icon="chevron-down" />
             </button>
           </p>