From 3bb3fefea72407282843f3c68d0919ca1a71b928 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Fri, 23 Jun 2023 17:03:14 +0530 Subject: [PATCH] Redirect to onboarding welcome screen if all profiles are removed (#16368) --- src/status_im2/contexts/onboarding/events.cljs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/status_im2/contexts/onboarding/events.cljs b/src/status_im2/contexts/onboarding/events.cljs index da38f97fda..fbb1234d76 100644 --- a/src/status_im2/contexts/onboarding/events.cljs +++ b/src/status_im2/contexts/onboarding/events.cljs @@ -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]}