Merge pull request #200 from status-im/feature/show-mnemonic-#199
show mnemonic on account creation
Former-commit-id: 995622307f
This commit is contained in:
commit
c6d6cec5d4
|
@ -36,6 +36,7 @@
|
|||
(let [data (json->clj result)
|
||||
public-key (:pubkey data)
|
||||
address (:address data)
|
||||
mnemonic (:mnemonic data)
|
||||
account {:public-key public-key
|
||||
:address address
|
||||
:name address
|
||||
|
@ -44,7 +45,8 @@
|
|||
(when (not (str/blank? public-key))
|
||||
(do
|
||||
(dispatch-sync [:add-account account])
|
||||
(dispatch [:login-account address password])))))
|
||||
(dispatch-sync [:save-password password mnemonic])
|
||||
(dispatch-sync [:login-account address password])))))
|
||||
|
||||
(register-handler :create-account
|
||||
(after #(dispatch [:init-wallet-chat]))
|
||||
|
|
|
@ -183,9 +183,8 @@
|
|||
(init-console-chat db false)))
|
||||
|
||||
(register-handler :save-password
|
||||
(fn [db [_ password]]
|
||||
(sign-up-service/save-password password)
|
||||
(dispatch [:create-account password])
|
||||
(fn [db [_ password mnemonic]]
|
||||
(sign-up-service/save-password password mnemonic)
|
||||
(assoc db :password-saved true)))
|
||||
|
||||
(register-handler :sign-up
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
:to "me"}])))
|
||||
|
||||
;; -- Saving password ----------------------------------------
|
||||
(defn save-password [password]
|
||||
(defn save-password [password mnemonic]
|
||||
;; TODO validate and save password
|
||||
(dispatch [:received-message
|
||||
{:msg-id (random/id)
|
||||
|
@ -133,17 +133,14 @@
|
|||
:from "console"
|
||||
:to "me"
|
||||
:new? false}])
|
||||
;; TODO generate passphrase
|
||||
(let [passphrase (str "The brash businessman's braggadocio and public squabbing with "
|
||||
"candidates in the US presidential election")]
|
||||
(dispatch [:received-message
|
||||
{:msg-id (random/id)
|
||||
:content passphrase
|
||||
:content mnemonic
|
||||
:content-type text-content-type
|
||||
:outgoing false
|
||||
:from "console"
|
||||
:to "me"
|
||||
:new? false}]))
|
||||
:new? false}])
|
||||
(dispatch [:received-message
|
||||
{:msg-id "8"
|
||||
:content (label :t/written-down)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
(def console-events
|
||||
{:save-password (fn [[parameter]]
|
||||
(dispatch [:save-password parameter]))
|
||||
(dispatch [:create-account parameter]))
|
||||
:sign-up (fn [[parameter]]
|
||||
(dispatch [:sign-up parameter]))
|
||||
:confirm-sign-up (fn [[parameter]]
|
||||
|
|
Loading…
Reference in New Issue