diff --git a/src/components/notification.jsx b/src/components/notification.jsx index cb2180c7..cfe25022 100644 --- a/src/components/notification.jsx +++ b/src/components/notification.jsx @@ -149,6 +149,9 @@ function Notification({ moderation_warning, _accounts, _statuses, + // Grouped notification + sampleAccounts, + notificationsCount, } = notification; let { type } = notification; @@ -167,12 +170,14 @@ function Notification({ let favsCount = 0; let reblogsCount = 0; if (type === 'favourite+reblog') { - for (const account of _accounts) { - if (account._types?.includes('favourite')) { - favsCount++; - } - if (account._types?.includes('reblog')) { - reblogsCount++; + if (_accounts) { + for (const account of _accounts) { + if (account._types?.includes('favourite')) { + favsCount++; + } + if (account._types?.includes('reblog')) { + reblogsCount++; + } } } if (!reblogsCount && favsCount) type = 'favourite'; @@ -296,6 +301,15 @@ function Notification({ people {' '} + ) : notificationsCount > 1 ? ( + <> + + + {shortenNumber(notificationsCount)} + {' '} + people + {' '} + ) : ( account && ( <> @@ -405,6 +419,54 @@ function Notification({

)} + {!_accounts?.length && sampleAccounts?.length > 1 && ( +

+ {sampleAccounts.map((account) => ( + +

+ {account._types.map((type) => ( + + ))} +
+ )} */} + {' '} + + ))} + {notificationsCount > sampleAccounts.length && ( + + +{notificationsCount - sampleAccounts.length} + + + )} +

+ )} {_statuses?.length > 1 && (