diff --git a/src/status_im2/contexts/onboarding/syncing/progress/view.cljs b/src/status_im2/contexts/onboarding/syncing/progress/view.cljs index a15167e73b..56b515d333 100644 --- a/src/status_im2/contexts/onboarding/syncing/progress/view.cljs +++ b/src/status_im2/contexts/onboarding/syncing/progress/view.cljs @@ -31,7 +31,9 @@ (defn try-again-button [profile-color] [quo/button - {:on-press #(rf/dispatch [:navigate-back]) + {:on-press (fn [] + (rf/dispatch [:syncing/clear-states]) + (rf/dispatch [:navigate-back])) :accessibility-label :try-again-later-button :override-background-color (colors/custom-color profile-color 60) :style style/try-again-button} diff --git a/src/status_im2/contexts/syncing/events.cljs b/src/status_im2/contexts/syncing/events.cljs index 84c9d0d726..6520f96119 100644 --- a/src/status_im2/contexts/syncing/events.cljs +++ b/src/status_im2/contexts/syncing/events.cljs @@ -24,6 +24,11 @@ [{:keys [db]} role] {:db (assoc-in db [:syncing :role] role)}) +(rf/defn local-pairing-clear-states + {:events [:syncing/clear-states]} + [{:keys [db]} role] + {:db (dissoc db :syncing)}) + (defn- get-default-node-config [installation-id] (let [db {:networks/current-network config/default-network diff --git a/src/status_im2/contexts/syncing/scan_sync_code/view.cljs b/src/status_im2/contexts/syncing/scan_sync_code/view.cljs index 35d18eff71..4a4102cde6 100644 --- a/src/status_im2/contexts/syncing/scan_sync_code/view.cljs +++ b/src/status_im2/contexts/syncing/scan_sync_code/view.cljs @@ -201,19 +201,23 @@ :text (i18n/label :t/camera-permission-denied)}])}]))] (fn [] - (let [camera-ref (atom nil) - read-qr-once? (atom false) - on-read-code (fn [data] - (when-not @read-qr-once? - (reset! read-qr-once? true) - (js/setTimeout (fn [] - (reset! read-qr-once? false)) - 3000) - (check-qr-code-data data))) - scan-qr-code-tab? (= @active-tab 1) - show-camera? (and scan-qr-code-tab? @camera-permission-granted?) - show-holes? (and show-camera? - (boolean (not-empty @qr-view-finder)))] + (let [camera-ref (atom nil) + read-qr-once? (atom false) + ;; The below check is to prevent scanning of any QR code + ;; when the user is in syncing progress screen + user-in-syncing-progress-screen? (= (rf/sub [:view-id]) :syncing-progress) + on-read-code (fn [data] + (when (and (not @read-qr-once?) + (not user-in-syncing-progress-screen?)) + (reset! read-qr-once? true) + (js/setTimeout (fn [] + (reset! read-qr-once? false)) + 3000) + (check-qr-code-data data))) + scan-qr-code-tab? (= @active-tab 1) + show-camera? (and scan-qr-code-tab? @camera-permission-granted?) + show-holes? (and show-camera? + (boolean (not-empty @qr-view-finder)))] (rn/use-effect (fn [] (when-not @camera-permission-granted?