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)
|
||||
(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
|
||||
[{:keys [db] :as cofx}]
|
||||
(fx/merge cofx
|
||||
{:db (-> db
|
||||
(assoc-in [:keycard :pin :status] :blocked-card)
|
||||
(assoc :popover/popover {:view :blocked-card}))}
|
||||
(hide-connection-sheet)))
|
||||
[cofx]
|
||||
(blocked-or-frozen-keycard-popup cofx :blocked-card))
|
||||
|
||||
(fx/defn frozen-keycard-popup
|
||||
[{:keys [db] :as cofx}]
|
||||
(if (:multiaccounts/login db)
|
||||
(fx/merge
|
||||
cofx
|
||||
{:db (assoc-in db [:keycard :pin :status] :frozen-card)}
|
||||
hide-connection-sheet)
|
||||
(popover/show-popover cofx {:view :frozen-card})))
|
||||
[cofx]
|
||||
(blocked-or-frozen-keycard-popup cofx :frozen-card))
|
||||
|
||||
(fx/defn on-get-keys-error
|
||||
{:events [:keycard.callback/on-get-keys-error]}
|
||||
|
|
Loading…
Reference in New Issue