0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 18:48:37 -05:00

🐛 Fix error handling on recovery request page

This commit is contained in:
Andrey Antukh 2024-03-06 09:16:45 +01:00
parent 1bc4001e70
commit 8cb550120a

View file

@ -49,19 +49,20 @@
on-error on-error
(mf/use-callback (mf/use-callback
(fn [data {:keys [code] :as error}] (fn [data cause]
(reset! submitted false) (reset! submitted false)
(case code (let [code (-> cause ex-data :code)]
:profile-not-verified (case code
(rx/of (msg/error (tr "auth.notifications.profile-not-verified"))) :profile-not-verified
(rx/of (msg/error (tr "auth.notifications.profile-not-verified")))
:profile-is-muted :profile-is-muted
(rx/of (msg/error (tr "errors.profile-is-muted"))) (rx/of (msg/error (tr "errors.profile-is-muted")))
:email-has-permanent-bounces :email-has-permanent-bounces
(rx/of (msg/error (tr "errors.email-has-permanent-bounces" (:email data)))) (rx/of (msg/error (tr "errors.email-has-permanent-bounces" (:email data))))
(rx/throw error)))) (rx/throw cause)))))
on-submit on-submit
(mf/use-callback (mf/use-callback