Reformat ViewModel

This commit is contained in:
Balazs Perlaki-Horvath 2023-11-14 11:05:20 +01:00
parent 7ef2f0e8de
commit a4c930c034

View File

@ -138,8 +138,7 @@ final class BrowserViewModel: NSObject, ObservableObject,
// update tab data // update tab data
if let tabID = self?.tabID, if let tabID = self?.tabID,
let tab = try? Database.viewContext.existingObject(with: tabID) as? Tab, let tab = try? Database.viewContext.existingObject(with: tabID) as? Tab,
let title let title {
{
tab.title = title tab.title = title
tab.zimFile = zimFile tab.zimFile = zimFile
} }
@ -195,8 +194,7 @@ final class BrowserViewModel: NSObject, ObservableObject,
// MARK: - Bookmark // MARK: - Bookmark
func controller(_: NSFetchedResultsController<NSFetchRequestResult>, func controller(_: NSFetchedResultsController<NSFetchRequestResult>,
didChangeContentWith snapshot: NSDiffableDataSourceSnapshotReference) didChangeContentWith snapshot: NSDiffableDataSourceSnapshotReference) {
{
articleBookmarked = !snapshot.itemIdentifiers.isEmpty articleBookmarked = !snapshot.itemIdentifiers.isEmpty
} }