mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 14:05:58 +03:00
Properly write item metadata status update to database in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
017de893f0
commit
2ca2609e0c
1 changed files with 6 additions and 2 deletions
|
@ -225,8 +225,12 @@ class NextcloudFilesDatabaseManager : NSObject {
|
|||
|
||||
do {
|
||||
try database.write {
|
||||
result = database.objects(NextcloudItemMetadataTable.self).filter("ocId == %@", metadata.ocId).first
|
||||
result?.status = status.rawValue
|
||||
guard let result = database.objects(NextcloudItemMetadataTable.self).filter("ocId == %@", metadata.ocId).first else {
|
||||
return
|
||||
}
|
||||
|
||||
result.status = status.rawValue
|
||||
database.add(result, update: .all)
|
||||
}
|
||||
} catch let error {
|
||||
NSLog("Could not update status for item metadata with ocID: %@ and filename: %@, received error: %@", metadata.ocId, metadata.fileNameView, error.localizedDescription)
|
||||
|
|
Loading…
Reference in a new issue