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:
parent
3ac6df7c26
commit
144dc59a7a
1 changed files with 11 additions and 1 deletions
|
@ -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)))
|
||||
|
||||
|
|
Loading…
Reference in a new issue