mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 10:43:39 +02:00
Fix all the "unregistered effects handler for :event" errors, closes #25
This commit is contained in:
parent
58327be930
commit
563cab9099
3 changed files with 31 additions and 36 deletions
|
|
@ -24,13 +24,13 @@
|
|||
(defn good-api-response
|
||||
"Handles when the server responded. There could still be an error while
|
||||
processing the request on the server side which we have to account for."
|
||||
[fx [_ endpoint params response]]
|
||||
(let [response-cache (cons :db (cache-path endpoint params))]
|
||||
[{:keys [db]} [_ endpoint params response]]
|
||||
(let [response-cache (cache-path endpoint params)]
|
||||
(try
|
||||
(assoc-in fx response-cache (api/unwrap-response response))
|
||||
{:db (assoc-in db response-cache (api/unwrap-response response))}
|
||||
(catch ExceptionInfo e
|
||||
{:dispatch [:notification/show :error (api/error-msg e)]
|
||||
:db (update-in fx response-cache dissoc :api/is-loading?)}))))
|
||||
:db (update-in db response-cache dissoc :api/is-loading?)}))))
|
||||
|
||||
(reg-event-fx :api/good-response good-api-response)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue