mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 08:46:38 +02:00
🐛 Fix error handling on account deletion process
This commit is contained in:
parent
7e44ae62a2
commit
2cddbc8a3d
2 changed files with 8 additions and 9 deletions
|
@ -537,10 +537,8 @@
|
||||||
on-success identity}} (meta params)]
|
on-success identity}} (meta params)]
|
||||||
(->> (rp/cmd! :delete-profile {})
|
(->> (rp/cmd! :delete-profile {})
|
||||||
(rx/tap on-success)
|
(rx/tap on-success)
|
||||||
(rx/delay-at-least 300)
|
(rx/catch on-error)
|
||||||
(rx/catch (constantly (rx/of 1)))
|
(rx/delay-at-least 300))))))
|
||||||
(rx/map logged-out)
|
|
||||||
(rx/catch on-error))))))
|
|
||||||
|
|
||||||
;; --- EVENT: request-profile-recovery
|
;; --- EVENT: request-profile-recovery
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,12 @@
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(defn on-error
|
(defn on-error
|
||||||
[{:keys [code] :as error}]
|
[cause]
|
||||||
(if (= :owner-teams-with-people code)
|
(let [code (-> cause ex-data :code)]
|
||||||
(let [msg (tr "notifications.profile-deletion-not-allowed")]
|
(if (= :owner-teams-with-people code)
|
||||||
(rx/of (msg/error msg)))
|
(let [msg (tr "notifications.profile-deletion-not-allowed")]
|
||||||
(rx/throw error)))
|
(rx/of (msg/error msg)))
|
||||||
|
(rx/throw cause))))
|
||||||
|
|
||||||
(mf/defc delete-account-modal
|
(mf/defc delete-account-modal
|
||||||
{::mf/register modal/components
|
{::mf/register modal/components
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue