From e02b39bf84aa91354c84f7442929cb83d60e723e Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 18 Nov 2022 14:17:26 -0600 Subject: [PATCH] Fix data loss on notifications-view update --- src/state/models/notifications-view.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/state/models/notifications-view.ts b/src/state/models/notifications-view.ts index b841c7f3..d9ef8f87 100644 --- a/src/state/models/notifications-view.ts +++ b/src/state/models/notifications-view.ts @@ -42,7 +42,7 @@ export class NotificationsViewItemModel implements GroupedNotification { this.copy(v) } - copy(v: GroupedNotification) { + copy(v: GroupedNotification, preserve = false) { this.uri = v.uri this.cid = v.cid this.author = v.author @@ -58,7 +58,7 @@ export class NotificationsViewItemModel implements GroupedNotification { new NotificationsViewItemModel(this.rootStore, '', add), ) } - } else { + } else if (!preserve) { this.additional = undefined } } @@ -322,7 +322,7 @@ export class NotificationsViewModel { item2 => item.uri === item2.uri && item.indexedAt === item2.indexedAt, ) if (existingItem) { - existingItem.copy(item) + existingItem.copy(item, true) } } }