mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 00:10:11 -05:00
Show properly conflict errors on colors page.
This commit is contained in:
parent
5fade8bb93
commit
c8683ea0ba
3 changed files with 11 additions and 2 deletions
|
@ -70,8 +70,11 @@
|
|||
"errors.form.max-len" "Should be less than %s"
|
||||
"errors.form.color" "Should be a valid color string"
|
||||
"errors.form.password-not-match" "Password does not match"
|
||||
"errors.generic" "Something work has happened."
|
||||
"errors.auth.unauthorized" "Username or passwords seems to be wrong."
|
||||
"errors.auth.invalid-recovery-token" "The recovery token is invalid."
|
||||
"errors.profile.update-password" "Error updating password, probably your old password is wrong."
|
||||
|
||||
"errors.generic" "Something work has happened."
|
||||
"errors.conflict" "Conflict on saving data, please refresh and try again."
|
||||
|
||||
})
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
(defn- on-error
|
||||
"A default error handler."
|
||||
[error]
|
||||
[{:keys [status] :as error}]
|
||||
(cond
|
||||
;; Unauthorized or Auth timeout
|
||||
(and (:status error)
|
||||
|
@ -59,6 +59,10 @@
|
|||
(= (:status error) 419)))
|
||||
(rs/emit! (dauth/logout))
|
||||
|
||||
;; Conflict
|
||||
(= status 412)
|
||||
(dmsg/error! (tr "errors.conflict"))
|
||||
|
||||
;; Network error
|
||||
(= (:status error) 0)
|
||||
(do
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
[uxbox.main.data.dashboard :as dd]
|
||||
[uxbox.main.data.lightbox :as udl]
|
||||
[uxbox.main.state :as st]
|
||||
[uxbox.main.ui.messages :as uum]
|
||||
[uxbox.main.ui.colorpicker :refer (colorpicker)]
|
||||
[uxbox.main.ui.dashboard.header :refer (header)]
|
||||
[uxbox.main.ui.forms :as form]
|
||||
|
@ -330,6 +331,7 @@
|
|||
colls (mx/react collections-ref)
|
||||
coll (get colls (:id state))]
|
||||
[:main.dashboard-main
|
||||
(uum/messages)
|
||||
(header)
|
||||
[:section.dashboard-content
|
||||
(nav state colls)
|
||||
|
|
Loading…
Reference in a new issue