this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix numbers inconsistency with grouped notifications

Some grouped grouped notifications will be ungrouped

+48 -13
+1
src/app.css
··· 2453 2453 display: flex; 2454 2454 flex-wrap: wrap; 2455 2455 gap: 4px; 2456 + align-items: center; 2456 2457 } 2457 2458 /* I'm just feeling bored, so having fun here */ 2458 2459 @media (hover: hover) {
+27 -2
src/components/notification.jsx
··· 324 324 sampleAccounts, 325 325 notificationsCount, 326 326 groupKey, 327 + _notificationsCount, 328 + _sampleAccountsCount, 327 329 } = notification; 328 330 let { type } = notification; 329 331 ··· 381 383 382 384 if (typeof text === 'function') { 383 385 const count = 384 - _accounts?.length || sampleAccounts?.length || (account ? 1 : 0); 386 + type === 'favourite' || type === 'reblog' 387 + ? notificationsCount 388 + : _accounts?.length || sampleAccounts?.length || (account ? 1 : 0); 385 389 const postsCount = _statuses?.length || (status ? 1 : 0); 386 390 if (type === 'admin.report') { 387 391 const targetAccount = report?.targetAccount; ··· 493 497 )} 494 498 </div> 495 499 <div class="notification-content"> 500 + {/* {(type === 'favourite+reblog' || 501 + type === 'favourite' || 502 + type === 'reblog') && ( 503 + <> 504 + 💥 {type} {expandAccounts}{' '} 505 + <mark> 506 + N{_notificationsCount?.join(',')} + A 507 + {_sampleAccountsCount?.join(',')} 508 + </mark>{' '} 509 + ‒{' '} 510 + <mark> 511 + N{notificationsCount} + A{sampleAccounts?.length} 512 + </mark> 513 + </> 514 + )} */} 496 515 {type !== 'mention' && ( 497 516 <> 498 517 <p>{text}</p> ··· 583 602 </a>{' '} 584 603 </Fragment> 585 604 ))} 586 - {type === 'favourite+reblog' && expandAccounts === 'remote' ? ( 605 + {(type === 'favourite+reblog' || 606 + type === 'favourite' || 607 + type === 'reblog') && 608 + expandAccounts === 'remote' ? ( 587 609 <button 588 610 type="button" 589 611 class="small plain" ··· 632 654 }; 633 655 }} 634 656 > 657 + + 658 + {(type === 'favourite' || type === 'reblog') && 659 + notificationsCount - _accounts.length} 635 660 <Icon icon="chevron-down" /> 636 661 </button> 637 662 ) : (
+10 -10
src/locales/en.po
··· 1075 1075 msgstr "" 1076 1076 1077 1077 #: src/components/generic-accounts.jsx:146 1078 - #: src/components/notification.jsx:445 1078 + #: src/components/notification.jsx:449 1079 1079 #: src/pages/accounts.jsx:42 1080 1080 #: src/pages/search.jsx:331 1081 1081 #: src/pages/search.jsx:364 ··· 1651 1651 msgid "Your account has been suspended." 1652 1652 msgstr "" 1653 1653 1654 - #: src/components/notification.jsx:372 1654 + #: src/components/notification.jsx:374 1655 1655 msgid "[Unknown notification type: {type}]" 1656 1656 msgstr "" 1657 1657 1658 - #: src/components/notification.jsx:441 1658 + #: src/components/notification.jsx:445 1659 1659 #: src/components/status.jsx:1102 1660 1660 #: src/components/status.jsx:1112 1661 1661 msgid "Boosted/Liked by…" 1662 1662 msgstr "" 1663 1663 1664 - #: src/components/notification.jsx:442 1664 + #: src/components/notification.jsx:446 1665 1665 msgid "Liked by…" 1666 1666 msgstr "" 1667 1667 1668 - #: src/components/notification.jsx:443 1668 + #: src/components/notification.jsx:447 1669 1669 msgid "Boosted by…" 1670 1670 msgstr "" 1671 1671 1672 - #: src/components/notification.jsx:444 1672 + #: src/components/notification.jsx:448 1673 1673 msgid "Followed by…" 1674 1674 msgstr "" 1675 1675 1676 - #: src/components/notification.jsx:514 1677 - #: src/components/notification.jsx:530 1676 + #: src/components/notification.jsx:533 1677 + #: src/components/notification.jsx:549 1678 1678 msgid "Learn more <0/>" 1679 1679 msgstr "" 1680 1680 1681 - #: src/components/notification.jsx:539 1681 + #: src/components/notification.jsx:558 1682 1682 msgid "View #Wrapstodon" 1683 1683 msgstr "View #Wrapstodon" 1684 1684 1685 - #: src/components/notification.jsx:773 1685 + #: src/components/notification.jsx:798 1686 1686 #: src/components/status.jsx:316 1687 1687 msgid "Read more →" 1688 1688 msgstr ""
+10 -1
src/utils/group-notifications.js
··· 91 91 let virtualType = type; 92 92 // const sameCount = notificationsCount > 0 && notificationsCount === sampleAccounts?.length; 93 93 // if (sameCount && (type === 'favourite' || type === 'reblog')) { 94 - if (type === 'favourite' || type === 'reblog') { 94 + const sampleCountDiffNotificationsCount = 95 + notificationsCount > 0 && 96 + sampleAccounts?.length > 0 && 97 + notificationsCount > sampleAccounts?.length; 98 + if ( 99 + !sampleCountDiffNotificationsCount && 100 + (type === 'favourite' || type === 'reblog') 101 + ) { 95 102 virtualType = 'favourite+reblog'; 96 103 } 97 104 // const key = `${status?.id}-${virtualType}-${date}-${sameCount ? 1 : 0}`; ··· 122 129 notificationsCount, 123 130 ); 124 131 mappedNotification._notificationsCount.push(notificationsCount); 132 + mappedNotification._sampleAccountsCount.push(sampleAccounts?.length); 125 133 mappedNotification._accounts = mappedNotification.sampleAccounts; 126 134 mappedNotification._groupKeys.push(groupKey); 127 135 } else { ··· 136 144 _accounts: accounts, 137 145 _groupKeys: groupKey ? [groupKey] : [], 138 146 _notificationsCount: [notificationsCount], 147 + _sampleAccountsCount: [sampleAccounts?.length], 139 148 }; 140 149 newGroupNotifications1.push(notificationsMap[key]); 141 150 }