Hide key storage selection screen temporarily

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
This commit is contained in:
Vitaliy Vlasov 2019-07-17 12:19:01 +03:00
parent 0d78e71ece
commit 8764fafc42
No known key found for this signature in database
GPG Key ID: A7D57C347F2B2964
2 changed files with 10 additions and 4 deletions

View File

@ -38,11 +38,17 @@
(defn dec-step [step]
(let [inverted (map-invert step-kw-to-num)]
(inverted (dec (step-kw-to-num step)))))
; Skip select-key-storage step
(if (= step :create-code)
:choose-key
(inverted (dec (step-kw-to-num step))))))
(defn inc-step [step]
(let [inverted (map-invert step-kw-to-num)]
(inverted (inc (step-kw-to-num step)))))
; Skip select-key-storage step
(if (= step :choose-key)
:create-code
(inverted (inc (step-kw-to-num step))))))
(defn get-status [cofx]
(assoc cofx :status (rand-nth statuses/data)))

View File

@ -24,7 +24,7 @@
(testing "Back from create-code"
(let [db {:intro-wizard {:step :create-code :key-code "qwerty"}}
result (get-in (models/intro-step-back {:db db}) [:db :intro-wizard])]
(is (= result {:step :select-key-storage :key-code nil :weak-password? true}))))
(is (= result {:step :choose-key :key-code nil :weak-password? true}))))
(testing "Back from confirm-code"
(let [db {:intro-wizard {:step :confirm-code :confirm-failure? true}}
@ -37,7 +37,7 @@
;; In this case intro-step-forward returns fx/merge result which is an fn
;; to be invoked on cofx
result (get-in ((models/intro-step-forward {:db db}) {:db db}) [:db :intro-wizard])]
(is (= result {:step :select-key-storage}))))
(is (= result {:step :create-code}))))
(testing "Forward from generate-key"
(let [db {:intro-wizard {:step :generate-key}}