diff --git a/apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookView.swift b/apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookView.swift index a462ae270..1e8f6e5bb 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookView.swift @@ -155,7 +155,7 @@ Spacer(minLength: 120) .listRowSeparator(.hidden, edges: .all) }.sheet(item: $setLabelsHighlight) { highlight in - ApplyLabelsView(mode: .highlight(highlight), isSearchFocused: false, onSave: { selectedLabels in + ApplyLabelsView(mode: .highlight(highlight), onSave: { selectedLabels in hasHighlightMutations = true viewModel.setLabelsForHighlight(highlightID: highlight.unwrappedID, diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index 39756c0a8..6be5a4831 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -81,7 +81,7 @@ struct AnimatingCellHeight: AnimatableModifier { loadItems(isRefresh: true) } .sheet(item: $viewModel.itemUnderLabelEdit) { item in - ApplyLabelsView(mode: .item(item), isSearchFocused: false, onSave: nil) + ApplyLabelsView(mode: .item(item), onSave: nil) } .sheet(item: $viewModel.itemUnderTitleEdit) { item in LinkedItemMetadataEditView(item: item) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift index 55cd8b6f9..78f2e1556 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift @@ -141,7 +141,7 @@ import Views Button(LocalText.cancelGeneric, role: .cancel) { self.itemToRemove = nil } } .sheet(item: $viewModel.itemUnderLabelEdit) { item in - ApplyLabelsView(mode: .item(item), isSearchFocused: false, onSave: nil) + ApplyLabelsView(mode: .item(item), onSave: nil) } .sheet(item: $viewModel.itemUnderTitleEdit) { item in LinkedItemMetadataEditView(item: item) diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift index 1ffa6cba7..3dc1f664f 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift @@ -3,6 +3,7 @@ import Services import SwiftUI import Views +@MainActor struct ApplyLabelsView: View { enum Mode { case item(LinkedItem) @@ -29,7 +30,6 @@ struct ApplyLabelsView: View { } let mode: Mode - let isSearchFocused: Bool let onSave: (([LinkedItemLabel]) -> Void)? @EnvironmentObject var dataService: DataService diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index 218673640..9707c0db8 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -337,7 +337,7 @@ struct WebReaderContainerView: View { .foregroundColor(ThemeManager.currentTheme.isDark ? .white : .black) .background(ThemeManager.currentBgColor) .sheet(isPresented: $showLabelsModal) { - ApplyLabelsView(mode: .item(item), isSearchFocused: false, onSave: { labels in + ApplyLabelsView(mode: .item(item), onSave: { labels in showLabelsModal = false item.labels = NSSet(array: labels) readerSettingsChangedTransactionID = UUID() @@ -478,7 +478,7 @@ struct WebReaderContainerView: View { } .sheet(isPresented: $showHighlightLabelsModal) { if let highlight = Highlight.lookup(byID: self.annotation, inContext: self.dataService.viewContext) { - ApplyLabelsView(mode: .highlight(highlight), isSearchFocused: false) { selectedLabels in + ApplyLabelsView(mode: .highlight(highlight)) { selectedLabels in viewModel.setLabelsForHighlight(highlightID: highlight.unwrappedID, labelIDs: selectedLabels.map(\.unwrappedID), dataService: dataService)