From 872c3d8d0b2a118fd5042c3368baa1a320938146 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 10 Apr 2023 16:15:57 +0800 Subject: [PATCH 1/2] Fix edit labels drop down action --- .../Sources/Services/DataService/DataService.swift | 7 +++++++ .../Services/DataService/Mutations/DeleteHighlight.swift | 1 + packages/web/components/patterns/ReaderDropdownMenu.tsx | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift b/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift index f878806bf..65cea6f84 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift @@ -55,6 +55,13 @@ public final class DataService: ObservableObject { backgroundContext.automaticallyMergesChangesFromParent = true backgroundContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump +// NotificationCenter.default.addObserver( +// forName: Notification.Name.NSManagedObjectContextObjectsDidChange, +// object: backgroundContext, queue: OperationQueue.main +// ) { note in +// print("MERGE NOTIFICATION: ", note) +// } + if isFirstTimeRunningNewAppBuild() { resetLocalStorage() } else { diff --git a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift index c2644d4fc..212a55f00 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift @@ -53,6 +53,7 @@ public extension DataService { context.perform { guard let highlight = Highlight.lookup(byID: highlightID, inContext: context) else { return } + print("LOOKED UP HIGHLIGHT: ", highlight, highlight.serverSyncStatus, highlight.serverSyncStatus) if isSyncSuccess { highlight.remove(inContext: context) diff --git a/packages/web/components/patterns/ReaderDropdownMenu.tsx b/packages/web/components/patterns/ReaderDropdownMenu.tsx index 8d75e0258..e9366416f 100644 --- a/packages/web/components/patterns/ReaderDropdownMenu.tsx +++ b/packages/web/components/patterns/ReaderDropdownMenu.tsx @@ -18,7 +18,7 @@ export function ReaderDropdownMenu(props: DropdownMenuProps): JSX.Element { title="Archive" /> props.articleActionHandler('editLabels')} + onSelect={() => props.articleActionHandler('setLabels')} title="Edit Labels" /> Date: Mon, 10 Apr 2023 17:13:04 +0800 Subject: [PATCH 2/2] Remove unneeded changes --- .../Sources/Services/DataService/DataService.swift | 7 ------- .../Services/DataService/Mutations/DeleteHighlight.swift | 1 - 2 files changed, 8 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift b/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift index 65cea6f84..f878806bf 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift @@ -55,13 +55,6 @@ public final class DataService: ObservableObject { backgroundContext.automaticallyMergesChangesFromParent = true backgroundContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump -// NotificationCenter.default.addObserver( -// forName: Notification.Name.NSManagedObjectContextObjectsDidChange, -// object: backgroundContext, queue: OperationQueue.main -// ) { note in -// print("MERGE NOTIFICATION: ", note) -// } - if isFirstTimeRunningNewAppBuild() { resetLocalStorage() } else { diff --git a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift index 212a55f00..c2644d4fc 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift @@ -53,7 +53,6 @@ public extension DataService { context.perform { guard let highlight = Highlight.lookup(byID: highlightID, inContext: context) else { return } - print("LOOKED UP HIGHLIGHT: ", highlight, highlight.serverSyncStatus, highlight.serverSyncStatus) if isSyncSuccess { highlight.remove(inContext: context)