Redirect to onboarding welcome screen if all profiles are removed (#16368)

This commit is contained in:
Parvesh Monu 2023-06-23 17:03:14 +05:30 committed by GitHub
parent 33b2e12e3b
commit 3bb3fefea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -121,7 +121,11 @@
(rf/defn on-delete-profile-success
{:events [:onboarding-2/on-delete-profile-success]}
[{:keys [db]} key-uid]
{:db (update-in db [:multiaccounts/multiaccounts] dissoc key-uid)})
(let [multiaccounts (dissoc (:multiaccounts/multiaccounts db) key-uid)]
(merge
{:db (assoc db :multiaccounts/multiaccounts multiaccounts)}
(when-not (seq multiaccounts)
{:set-root :intro}))))
(rf/defn password-set
{:events [:onboarding-2/password-set]}