handle multiple calls to frozen-keycard-popup
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
614f7211d2
commit
e3f471ecf6
|
@ -362,22 +362,24 @@
|
||||||
(clear-on-card-read)
|
(clear-on-card-read)
|
||||||
(hide-connection-sheet))))
|
(hide-connection-sheet))))
|
||||||
|
|
||||||
|
(fx/defn blocked-or-frozen-keycard-popup
|
||||||
|
[{:keys [db] :as cofx} card-status]
|
||||||
|
(fx/merge
|
||||||
|
cofx
|
||||||
|
{:db (assoc-in db [:keycard :pin :status] card-status)}
|
||||||
|
(hide-connection-sheet)
|
||||||
|
; do not try to display the popover if it is already open or
|
||||||
|
; we are in the login interface (which has a different handling)
|
||||||
|
(when-not (or (:multiaccounts/login db) (:popover/popover db))
|
||||||
|
(popover/show-popover {:view card-status}))))
|
||||||
|
|
||||||
(fx/defn blocked-keycard-popup
|
(fx/defn blocked-keycard-popup
|
||||||
[{:keys [db] :as cofx}]
|
[cofx]
|
||||||
(fx/merge cofx
|
(blocked-or-frozen-keycard-popup cofx :blocked-card))
|
||||||
{:db (-> db
|
|
||||||
(assoc-in [:keycard :pin :status] :blocked-card)
|
|
||||||
(assoc :popover/popover {:view :blocked-card}))}
|
|
||||||
(hide-connection-sheet)))
|
|
||||||
|
|
||||||
(fx/defn frozen-keycard-popup
|
(fx/defn frozen-keycard-popup
|
||||||
[{:keys [db] :as cofx}]
|
[cofx]
|
||||||
(if (:multiaccounts/login db)
|
(blocked-or-frozen-keycard-popup cofx :frozen-card))
|
||||||
(fx/merge
|
|
||||||
cofx
|
|
||||||
{:db (assoc-in db [:keycard :pin :status] :frozen-card)}
|
|
||||||
hide-connection-sheet)
|
|
||||||
(popover/show-popover cofx {:view :frozen-card})))
|
|
||||||
|
|
||||||
(fx/defn on-get-keys-error
|
(fx/defn on-get-keys-error
|
||||||
{:events [:keycard.callback/on-get-keys-error]}
|
{:events [:keycard.callback/on-get-keys-error]}
|
||||||
|
|
Loading…
Reference in New Issue