this repo has no description
0
fork

Configure Feed

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

Distinct both implementation of grouped notifications

+14 -12
+4 -2
src/components/notification.jsx
··· 147 147 report, 148 148 event, 149 149 moderation_warning, 150 + // Client-side grouped notification 151 + _ids, 150 152 _accounts, 151 153 _statuses, 152 - // Grouped notification 154 + // Server-side grouped notification 153 155 sampleAccounts, 154 156 notificationsCount, 155 157 } = notification; ··· 266 268 return ( 267 269 <div 268 270 class={`notification notification-${type}`} 269 - data-notification-id={id} 271 + data-notification-id={_ids || id} 270 272 tabIndex="0" 271 273 > 272 274 <div
+1 -1
src/pages/home.jsx
··· 177 177 .slice(0, NOTIFICATIONS_DISPLAY_LIMIT) 178 178 .map((notification) => ( 179 179 <Notification 180 - key={notification.ids || notification.id} 180 + key={notification._ids || notification.id} 181 181 instance={instance} 182 182 notification={notification} 183 183 disableContextMenu
+2 -2
src/pages/notifications.jsx
··· 716 716 hideTime: true, 717 717 }); 718 718 return ( 719 - <Fragment key={notification.ids || notification.id}> 719 + <Fragment key={notification._ids || notification.id}> 720 720 {differentDay && <h2 class="timeline-header">{heading}</h2>} 721 721 <Notification 722 722 instance={instance} 723 723 notification={notification} 724 - key={notification.ids || notification.id} 724 + key={notification._ids || notification.id} 725 725 /> 726 726 </Fragment> 727 727 );
+7 -7
src/utils/group-notifications.jsx
··· 99 99 const mappedNotification = notificationsMap2[key]; 100 100 if (mappedNotification) { 101 101 mappedNotification._statuses.push(gn.status); 102 - mappedNotification.ids += `-${gn.id}`; 102 + mappedNotification._ids += `-${gn.id}`; 103 103 } else { 104 104 let n = (notificationsMap2[key] = { 105 - ids: gn.id, 106 105 ...gn, 107 106 type, 107 + _ids: gn.id, 108 108 _statuses: [gn.status], 109 109 }); 110 110 newGroupNotifications2.push(n); ··· 145 145 if (mappedAccount) { 146 146 mappedAccount._types.push(type); 147 147 mappedAccount._types.sort().reverse(); 148 - mappedNotification.ids += `-${id}`; 148 + mappedNotification._ids += `-${id}`; 149 149 } else { 150 150 account._types = [type]; 151 151 mappedNotification._accounts.push(account); 152 - mappedNotification.ids += `-${id}`; 152 + mappedNotification._ids += `-${id}`; 153 153 } 154 154 } else { 155 155 if (account) account._types = [type]; 156 156 let n = (notificationsMap[key] = { 157 - ids: id, 158 157 ...notification, 159 158 type: virtualType, 159 + _ids: id, 160 160 _accounts: account ? [account] : [], 161 161 }); 162 162 cleanNotifications[j++] = n; ··· 179 179 const mappedNotification = notificationsMap2[key]; 180 180 if (mappedNotification) { 181 181 mappedNotification._statuses.push(notification.status); 182 - mappedNotification.ids += `-${id}`; 182 + mappedNotification._ids += `-${id}`; 183 183 } else { 184 184 let n = (notificationsMap2[key] = { 185 - ids: id, 186 185 ...notification, 187 186 type, 187 + _ids: id, 188 188 _statuses: [notification.status], 189 189 }); 190 190 cleanNotifications2[j++] = n;