Skip to content

Commit

Permalink
Fixed item list icon not updated when main attachment is added/removed (
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka authored Nov 6, 2023
1 parent cab5523 commit 251b356
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Zotero.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6082,7 +6082,7 @@
repositoryURL = "https://github.com/realm/realm-cocoa";
requirement = {
kind = exactVersion;
version = 10.43.1;
version = 10.44.0;
};
};
B35E4B8B25248B3C000EA134 /* XCRemoteSwiftPackageReference "RxSwift" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-cocoa",
"state" : {
"revision" : "a3da8c91ee44c7610d4b1100bd3079ddca26ab84",
"version" : "10.43.1"
"revision" : "fd199ce07edb4db69e862f74151b95602aad3b43",
"version" : "10.44.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct MoveItemsToParentDbRequest: DbRequest {
}

// Update the parent item, so that it's updated in the item list to show attachment/note marker
parent.baseTitle = parent.baseTitle
parent.changeType = .user
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct RemoveItemFromParentDbRequest: DbRequest {
func process(in database: Realm) throws {
guard let item = database.objects(RItem.self).filter(.key(self.key, in: self.libraryId)).first, item.parent != nil else { return }
// Update the parent item, so that it's updated in the item list to hide attachment/note marker
item.parent?.baseTitle = item.parent?.baseTitle ?? ""
item.parent?.changeType = .user
item.parent = nil
item.changes.append(RObjectChange.create(changes: RItemChanges.parent))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,8 @@ struct ItemsActionHandler: ViewModelActionHandler, BackgroundDbProcessingActionH
if state.selectedItems.remove(key) != nil {
state.changes.insert(.selection)
}
state.itemAccessories[key] = nil
state.itemTitles[key] = nil
}
}

Expand Down

0 comments on commit 251b356

Please sign in to comment.