1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00

Use the search query UI state

This commit is contained in:
Daniel Barber 2020-01-13 21:59:06 -05:00
parent 04d4c77f8d
commit 9f948df141
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
2 changed files with 5 additions and 2 deletions

View File

@ -163,8 +163,7 @@ class WindowController: NSWindowController {
}
@IBAction func handleSearchQuery(_ sender: NSSearchField) {
//App.store.dispatch(SetSearchQuery(searchQuery: sender.stringValue))
App.mpdClient.fetchAlbums(filter: sender.stringValue)
App.store.dispatch(SetSearchQuery(searchQuery: sender.stringValue))
}
}

View File

@ -6,6 +6,7 @@
// Copyright © 2019 Dan Barber. All rights reserved.
//
import AppKit
import ReSwift
func uiReducer(action: Action, state: UIState?) -> UIState {
@ -35,6 +36,9 @@ func uiReducer(action: Action, state: UIState?) -> UIState {
case let action as SetSearchQuery:
state.searchQuery = action.searchQuery
DispatchQueue.main.async {
App.mpdClient.fetchAlbums(filter: state.searchQuery)
}
default:
break