+8
-9
src/app/shared/utils/notification-utils.ts
+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
21
-
const slice = notifications.filter(n =>
22
22
-
(n.reasonSubject === notifications[0].reasonSubject && n.reason === notifications[0].reason)
23
23
-
);
24
24
-
25
25
-
temp.authors = slice.map(s => s.author);
21
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
30
-
target.push(temp);
26
26
+
notifications.shift();
27
27
+
28
28
+
while (notifications[0]?.reason && notifications[0].reasonSubject == temp.notification.reasonSubject && notifications[0].reason == temp.notification.reason) {
29
29
+
temp.authors.push(notifications[0].author);
30
30
+
notifications.shift();
31
31
+
}
31
32
32
32
-
notifications = notifications.filter(n =>
33
33
-
!(n.reasonSubject === notifications[0].reasonSubject && n.reason === notifications[0].reason)
34
34
-
);
33
33
+
target.push(temp);
35
34
}
36
35
}
37
36