mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
reference the correct searchQuery var in macapp
This commit is contained in:
parent
1bdd79e873
commit
2ebe340509
1 changed files with 3 additions and 4 deletions
|
|
@ -9,7 +9,6 @@ import Views
|
|||
#if os(macOS)
|
||||
struct HomeFeedView: View {
|
||||
@EnvironmentObject var dataService: DataService
|
||||
@State var searchQuery = ""
|
||||
@State private var selectedLinkItem: FeedItem?
|
||||
@State private var itemToRemove: FeedItem?
|
||||
@State private var confirmationShown = false
|
||||
|
|
@ -82,17 +81,17 @@ import Views
|
|||
.listStyle(PlainListStyle())
|
||||
.navigationTitle("Home")
|
||||
.searchable(
|
||||
text: $searchQuery,
|
||||
text: $viewModel.searchQuery,
|
||||
placement: .toolbar
|
||||
) {
|
||||
if searchQuery.isEmpty {
|
||||
if viewModel.searchQuery.isEmpty {
|
||||
Text("Inbox").searchCompletion("in:inbox ")
|
||||
Text("All").searchCompletion("in:all ")
|
||||
Text("Archived").searchCompletion("in:archive ")
|
||||
Text("Files").searchCompletion("type:file ")
|
||||
}
|
||||
}
|
||||
.onChange(of: searchQuery) { _ in
|
||||
.onChange(of: viewModel.searchQuery) { _ in
|
||||
// Maybe we should debounce this, but
|
||||
// it feels like it works ok without
|
||||
viewModel.loadItems(dataService: dataService, isRefresh: true)
|
||||
|
|
|
|||
Loading…
Reference in a new issue