[Fix] QR scanner scanning QR when user moved to next screen (#16012)
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
This commit is contained in:
parent
9a4f8f97b9
commit
863dac6e6a
|
@ -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}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -203,8 +203,12 @@
|
|||
(fn []
|
||||
(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-not @read-qr-once?
|
||||
(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))
|
||||
|
|
Loading…
Reference in New Issue