Skip to content

Commit

Permalink
Pop qr-scanner from nav stack
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Nov 21, 2019
1 parent 0b1da0e commit 3290270
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/status_im/qr_scanner/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
(:require [re-frame.core :as re-frame]
[status-im.i18n :as i18n]
[status-im.utils.utils :as utils]
[status-im.utils.fx :as fx]))
[status-im.utils.fx :as fx]
[status-im.utils.navigation :as navigation]))

(fx/defn scan-qr-code
[{:keys [db]} {:keys [deny-handler] :as identifier} qr-codes]
Expand All @@ -21,11 +22,16 @@

(fx/defn set-qr-code
[{:keys [db]} context data]
(merge {:db (-> db
(update :qr-codes dissoc context)
(dissoc :current-qr-context))}
(when-let [qr-codes (get-in db [:qr-codes context])]
{:dispatch [(:handler qr-codes) context data (dissoc qr-codes :handler)]})))
(let [navigation-stack {:chat-stack :home}]
(navigation/navigate-reset {:index 0
:key :chat-stack
:actions [{:routeName :home}]})
(merge {:db (-> db
(update :qr-codes dissoc context)
(dissoc :current-qr-context)
(update :navigation-stack navigation-stack'))}
(when-let [qr-codes (get-in db [:qr-codes context])]
{:dispatch [(:handler qr-codes) context data (dissoc qr-codes :handler)]}))))

(fx/defn set-qr-code-cancel
[{:keys [db]} context]
Expand Down

0 comments on commit 3290270

Please sign in to comment.