about summary refs log tree commit diff
path: root/src/state/models/notifications-view.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-11-18 14:17:26 -0600
committerPaul Frazee <pfrazee@gmail.com>2022-11-18 14:17:26 -0600
commite02b39bf84aa91354c84f7442929cb83d60e723e (patch)
treeffe875d061328f4b0aa5054cb2908925fd28a633 /src/state/models/notifications-view.ts
parentfbb9689e4a0c32244bf8cdcae48783bd1f2f7c10 (diff)
downloadvoidsky-e02b39bf84aa91354c84f7442929cb83d60e723e.tar.zst
Fix data loss on notifications-view update
Diffstat (limited to 'src/state/models/notifications-view.ts')
-rw-r--r--src/state/models/notifications-view.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state/models/notifications-view.ts b/src/state/models/notifications-view.ts
index b841c7f3a..d9ef8f877 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)
       }
     }
   }