mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 23:31:21 -05: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)]
|
||||
(->> (rp/cmd! :delete-profile {})
|
||||
(rx/tap on-success)
|
||||
(rx/delay-at-least 300)
|
||||
(rx/catch (constantly (rx/of 1)))
|
||||
(rx/map logged-out)
|
||||
(rx/catch on-error))))))
|
||||
(rx/catch on-error)
|
||||
(rx/delay-at-least 300))))))
|
||||
|
||||
;; --- EVENT: request-profile-recovery
|
||||
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
[rumext.v2 :as mf]))
|
||||
|
||||
(defn on-error
|
||||
[{:keys [code] :as error}]
|
||||
[cause]
|
||||
(let [code (-> cause ex-data :code)]
|
||||
(if (= :owner-teams-with-people code)
|
||||
(let [msg (tr "notifications.profile-deletion-not-allowed")]
|
||||
(rx/of (msg/error msg)))
|
||||
(rx/throw error)))
|
||||
(rx/throw cause))))
|
||||
|
||||
(mf/defc delete-account-modal
|
||||
{::mf/register modal/components
|
||||
|
|
Loading…
Add table
Reference in a new issue