Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
levitatingpineapple committed Jan 15, 2024
1 parent 4fcbb6f commit 0d52bed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion App/Store/Store.Feed.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ extension Store {
// 2. Merge fetched items with synced state (isRead, isStarred) and insert
for content in mapped.contents {
var item = content.item
var itemChanged = true
if let stored = try? Item.filter(id: content.item.id).fetchOne($0) {
item.isRead = stored.isRead
item.isStarred = stored.isStarred
item.sync = stored.sync
item.extracted = stored.extracted
itemChanged = item != stored
}
try? content.item.insert($0)
if itemChanged { try? item.insert($0) }
let _ = try Attachment
.filter(Attachment.CodingKeys.itemId.column == item.id)
.deleteAll($0)
Expand Down

0 comments on commit 0d52bed

Please sign in to comment.