Multicolumn Bluesky client powered by Angular

improvement: keep notification chunks divided by siblings, not the whole processed array

kbenlloch 3871aeb9 74ab8d84

Changed files
+8 -9
src
app
shared
+8 -9
src/app/shared/utils/notification-utils.ts
··· 18 18 target.push(temp); 19 19 notifications.shift(); 20 20 } else if (notifications[0].reason) { 21 - const slice = notifications.filter(n => 22 - (n.reasonSubject === notifications[0].reasonSubject && n.reason === notifications[0].reason) 23 - ); 24 - 25 - temp.authors = slice.map(s => s.author); 21 + temp.authors = [notifications[0].author]; 26 22 temp.reason = notifications[0].reason; 27 23 temp.notification = notifications[0]; 28 24 temp.uri = notifications[0].reasonSubject; 29 25 30 - target.push(temp); 26 + notifications.shift(); 27 + 28 + while (notifications[0]?.reason && notifications[0].reasonSubject == temp.notification.reasonSubject && notifications[0].reason == temp.notification.reason) { 29 + temp.authors.push(notifications[0].author); 30 + notifications.shift(); 31 + } 31 32 32 - notifications = notifications.filter(n => 33 - !(n.reasonSubject === notifications[0].reasonSubject && n.reason === notifications[0].reason) 34 - ); 33 + target.push(temp); 35 34 } 36 35 } 37 36