Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<div #uiScroll *uiScroll="let item of datasource; let index = index">
<div
class="notifications__list-item"
*ngIf="item"
[ngClass]="{
'last-item': index === totalItems - 1,
'border-none': !item.action && !expandNotifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,13 @@ export class NotificationsListComponent implements OnInit {
// Map all notifications to a format that is easy for our template to render
// Filter out any null notifications we couldn't process

const chunk = res.Notifications.map((notification) => this.transformNotification(notification)).filter(
Boolean
const chunk = res.Notifications.flatMap((notification) => {
if (notification.Metadata.TxnType === 'ATOMIC_TXNS_WRAPPER') {
return notification.Metadata.AtomicTxnsWrapperTxindexMetadata.InnerTxnsTransactionMetadata.map(
(innerTxn) => this.transformNotification(innerTxn));
}
return [this.transformNotification(notification)];
}
);

// Index 0 means we're done. if the array is empty we're done.
Expand Down Expand Up @@ -182,7 +187,10 @@ export class NotificationsListComponent implements OnInit {
// NOTE: We support rendering unfollows and unlikes but they're currently filtered
// out by frontend_server's TxnMetaIsNotification
protected transformNotification(notification: any) {
const txnMeta = notification.Metadata;
let txnMeta = notification.Metadata;
if (!txnMeta) {
txnMeta = notification;
}
const userPublicKeyBase58Check = this.globalVars.loggedInUser?.PublicKeyBase58Check;

if (txnMeta == null) {
Expand Down