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:
parent
04d4c77f8d
commit
9f948df141
@ -163,8 +163,7 @@ class WindowController: NSWindowController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func handleSearchQuery(_ sender: NSSearchField) {
|
@IBAction func handleSearchQuery(_ sender: NSSearchField) {
|
||||||
//App.store.dispatch(SetSearchQuery(searchQuery: sender.stringValue))
|
App.store.dispatch(SetSearchQuery(searchQuery: sender.stringValue))
|
||||||
App.mpdClient.fetchAlbums(filter: sender.stringValue)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
// Copyright © 2019 Dan Barber. All rights reserved.
|
// Copyright © 2019 Dan Barber. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import AppKit
|
||||||
import ReSwift
|
import ReSwift
|
||||||
|
|
||||||
func uiReducer(action: Action, state: UIState?) -> UIState {
|
func uiReducer(action: Action, state: UIState?) -> UIState {
|
||||||
@ -35,6 +36,9 @@ func uiReducer(action: Action, state: UIState?) -> UIState {
|
|||||||
|
|
||||||
case let action as SetSearchQuery:
|
case let action as SetSearchQuery:
|
||||||
state.searchQuery = action.searchQuery
|
state.searchQuery = action.searchQuery
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
App.mpdClient.fetchAlbums(filter: state.searchQuery)
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user