From 11bd340a9406881e33c0b5dc467007aaf511ec05 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Fri, 2 Aug 2024 15:17:18 +0530 Subject: [PATCH] fix 'Usage data' bottom sheet reappears after reopening the app if you swipe it down on onboarding (#20945) --- src/status_im/contexts/centralized_metrics/events.cljs | 9 +++++++-- src/status_im/contexts/profile/events.cljs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/status_im/contexts/centralized_metrics/events.cljs b/src/status_im/contexts/centralized_metrics/events.cljs index 078e5ab3a4..83f1ffa1b6 100644 --- a/src/status_im/contexts/centralized_metrics/events.cljs +++ b/src/status_im/contexts/centralized_metrics/events.cljs @@ -46,6 +46,11 @@ (when (show-confirmation-modal? db) {:fx [[:dispatch [:show-bottom-sheet - {:content (fn [] [modal-view]) - :shell? true}]]]}))) + {:content (fn [] [modal-view]) + ;; When in the profiles screen do biometric auth after the metrics sheet is dismissed + ;; https://github.com/status-im/status-mobile/issues/20932 + :on-close (when (= (:view-id db) :screen/profile.profiles) + #(rf/dispatch [:profile.login/login-with-biometric-if-available + (get-in db [:profile/login :key-uid])])) + :shell? true}]]]}))) diff --git a/src/status_im/contexts/profile/events.cljs b/src/status_im/contexts/profile/events.cljs index fa74a525fd..9765f69ef7 100644 --- a/src/status_im/contexts/profile/events.cljs +++ b/src/status_im/contexts/profile/events.cljs @@ -54,7 +54,7 @@ (update :profile/login #(select-profile % key-uid))) db-with-settings) :fx [[:dispatch [:init-root :screen/profile.profiles]] - (when key-uid + (when (and key-uid userConfirmed) [:effects.biometric/check-if-available {:key-uid key-uid :on-success (fn [auth-method]