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

use getState in middleware to read the preferences

This commit is contained in:
Christian Tietze 2019-08-02 20:37:21 +02:00
parent 8e12b144e6
commit 20430c58e3

View File

@ -13,6 +13,8 @@ let mpdClientMiddleware: Middleware<AppState> = { dispatch, getState in
return { action in
next(action)
guard let state = getState() else { return }
switch action {
case is MPDConnectAction:
let mpdServer = App.store.state.preferencesState.mpdServer