-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix item detail editing for attachment type * Update Item date modified with each saved change * Improve code * Add isEditable property to ItemDetailState.Field struct * Improve code * Improve code * Use OrderedDictionary for ItemDetailState creators * Improve code * Improve item fields editing Delay item fields editing in action handler instead of debouncing row text fields Update collection view snapshot when individual rows change * Make ItemDetailState.Data isAttachment a computed property * Remove unused code * Remove ItemDetailState.Data attributedTitle property * Improve BackgroundTimer code * Cache Item Detail State attributed title upon change * Improve comment * Improve item fields edit delay timer logic * Simplify BackgroundTimer * Simplify ItemDetailActionHandler logic for endEditing ItemAction * Improve code * End pending item creations on app launch Fix app delegate migration
- Loading branch information
Showing
15 changed files
with
533 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Zotero/Controllers/Database/Requests/EndItemCreationDbRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// EndItemCreationDbRequest.swift | ||
// Zotero | ||
// | ||
// Created by Michal Rentka on 12.10.2023. | ||
// Copyright © 2023 Corporation for Digital Scholarship. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import CocoaLumberjackSwift | ||
import RealmSwift | ||
|
||
struct EndItemCreationDbRequest: DbRequest { | ||
var needsWrite: Bool { return true } | ||
|
||
let libraryId: LibraryIdentifier | ||
let itemKey: String | ||
|
||
func process(in database: Realm) throws { | ||
guard let item = database.objects(RItem.self).uniqueObject(key: itemKey, libraryId: libraryId) else { return } | ||
item.changesSyncPaused = false | ||
item.changeType = .user | ||
} | ||
} | ||
|
||
struct EndPendingItemCreationsDbRequest: DbRequest { | ||
var needsWrite: Bool { return true } | ||
|
||
func process(in database: Realm) throws { | ||
let pendingItems = database.objects(RItem.self).filter("changesSyncPaused == true") | ||
guard !pendingItems.isEmpty else { return } | ||
DDLogInfo("EndPendingItemCreationsDbRequest: ending creation for \(pendingItems.count) pending items") | ||
for item in pendingItems { | ||
guard !item.isInvalidated else { continue } | ||
item.changesSyncPaused = false | ||
item.changeType = .user | ||
} | ||
} | ||
} |
26 changes: 0 additions & 26 deletions
26
Zotero/Controllers/Database/Requests/EndItemDetailEditingDbRequest.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.