0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

Add specific error handler for disable loader in an unexpected error.

This commit is contained in:
Andrey Antukh 2016-05-16 13:29:43 +03:00
parent 3ac6df7c26
commit 144dc59a7a
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -9,8 +9,11 @@
(:require [beicon.core :as rx]
[lentes.core :as l]
[uxbox.rstore :as rs]
[uxbox.locales :refer (tr)]
[uxbox.util.storage :refer (storage)]))
(enable-console-print!)
(defonce state (atom {}))
(def auth-l
@ -19,7 +22,7 @@
(def loader (atom false))
(defn get-initial-state
(defn- get-initial-state
[]
{:dashboard {:project-order :name
:project-filter ""}
@ -35,6 +38,13 @@
:projects-by-id {}
:pages-by-id {}})
(defn- on-error
[error]
;; Disable loader in case of error.
(reset! loader false))
(rs/add-error-watcher :test on-error)
(defonce stream
(rs/init (get-initial-state)))