File tree 1 file changed +15
-13
lines changed
1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change 362
362
(clear-on-card-read )
363
363
(hide-connection-sheet ))))
364
364
365
+ (fx/defn blocked-or-frozen-keycard-popup
366
+ [{:keys [db] :as cofx} card-status]
367
+ (fx/merge
368
+ cofx
369
+ {:db (assoc-in db [:keycard :pin :status ] card-status)}
370
+ (hide-connection-sheet )
371
+ ; do not try to display the popover if it is already open or
372
+ ; we are in the login interface (which has a different handling)
373
+ (when-not (or (:multiaccounts/login db) (:popover/popover db))
374
+ (popover/show-popover {:view card-status}))))
375
+
365
376
(fx/defn blocked-keycard-popup
366
- [{:keys [db] :as cofx}]
367
- (fx/merge cofx
368
- {:db (-> db
369
- (assoc-in [:keycard :pin :status ] :blocked-card )
370
- (assoc :popover/popover {:view :blocked-card }))}
371
- (hide-connection-sheet )))
377
+ [cofx]
378
+ (blocked-or-frozen-keycard-popup cofx :blocked-card ))
372
379
373
380
(fx/defn frozen-keycard-popup
374
- [{:keys [db] :as cofx}]
375
- (if (:multiaccounts/login db)
376
- (fx/merge
377
- cofx
378
- {:db (assoc-in db [:keycard :pin :status ] :frozen-card )}
379
- hide-connection-sheet)
380
- (popover/show-popover cofx {:view :frozen-card })))
381
+ [cofx]
382
+ (blocked-or-frozen-keycard-popup cofx :frozen-card ))
381
383
382
384
(fx/defn on-get-keys-error
383
385
{:events [:keycard.callback/on-get-keys-error ]}
You can’t perform that action at this time.
0 commit comments