this repo has no description
0
fork

Configure Feed

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

Fix notification markers not working

Also the ids are getting confusing, so need to clean this up.

+13 -10
+3 -3
src/pages/home.jsx
··· 109 109 110 110 const groupedNotifications = getGroupedNotifications(notifications); 111 111 112 - states.notificationsLast = notifications[0]; 112 + states.notificationsLast = groupedNotifications[0]; 113 113 states.notifications = groupedNotifications; 114 114 115 115 // Update last read marker 116 116 masto.v1.markers 117 117 .create({ 118 118 notifications: { 119 - lastReadId: notifications[0].id, 119 + lastReadId: groupedNotifications[0].id, 120 120 }, 121 121 }) 122 122 .catch(() => {}); ··· 177 177 .slice(0, NOTIFICATIONS_DISPLAY_LIMIT) 178 178 .map((notification) => ( 179 179 <Notification 180 - key={notification.id} 180 + key={notification.ids || notification.id} 181 181 instance={instance} 182 182 notification={notification} 183 183 disableContextMenu
+3 -3
src/pages/notifications.jsx
··· 165 165 masto.v1.markers 166 166 .create({ 167 167 notifications: { 168 - lastReadId: notifications[0].id, 168 + lastReadId: groupedNotifications[0].id, 169 169 }, 170 170 }) 171 171 .catch(() => {}); ··· 716 716 hideTime: true, 717 717 }); 718 718 return ( 719 - <Fragment key={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.id} 724 + key={notification.ids || notification.id} 725 725 /> 726 726 </Fragment> 727 727 );
+7 -4
src/utils/group-notifications.jsx
··· 99 99 const mappedNotification = notificationsMap2[key]; 100 100 if (mappedNotification) { 101 101 mappedNotification._statuses.push(gn.status); 102 - mappedNotification.id += `-${gn.id}`; 102 + mappedNotification.ids += `-${gn.id}`; 103 103 } else { 104 104 let n = (notificationsMap2[key] = { 105 + ids: gn.id, 105 106 ...gn, 106 107 type, 107 108 _statuses: [gn.status], ··· 144 145 if (mappedAccount) { 145 146 mappedAccount._types.push(type); 146 147 mappedAccount._types.sort().reverse(); 147 - mappedNotification.id += `-${id}`; 148 + mappedNotification.ids += `-${id}`; 148 149 } else { 149 150 account._types = [type]; 150 151 mappedNotification._accounts.push(account); 151 - mappedNotification.id += `-${id}`; 152 + mappedNotification.ids += `-${id}`; 152 153 } 153 154 } else { 154 155 if (account) account._types = [type]; 155 156 let n = (notificationsMap[key] = { 157 + ids: id, 156 158 ...notification, 157 159 type: virtualType, 158 160 _accounts: account ? [account] : [], ··· 177 179 const mappedNotification = notificationsMap2[key]; 178 180 if (mappedNotification) { 179 181 mappedNotification._statuses.push(notification.status); 180 - mappedNotification.id += `-${id}`; 182 + mappedNotification.ids += `-${id}`; 181 183 } else { 182 184 let n = (notificationsMap2[key] = { 185 + ids: id, 183 186 ...notification, 184 187 type, 185 188 _statuses: [notification.status],