fix account creation without status-go

This commit is contained in:
Roman Volosovskyi 2017-12-15 16:27:09 +02:00
parent a7f8526c88
commit 8349379509
No known key found for this signature in database
GPG Key ID: 37135489EAE4B2D7
2 changed files with 10 additions and 4 deletions

View File

@ -28,7 +28,7 @@
(-discard-transaction [this id])
(-parse-jail [this chat-id file callback]
(when (= chat-id constants/console-chat-id)
(callback "{\"result\": {\"commands\":{\"debug\":{\"color\":\"#7099e6\",\"description\":\"Starts/stops a debug mode\",\"has-handler\":false,\"name\":\"debug\",\"params\":[{\"name\":\"mode\",\"type\":\"text\"}],\"registered-only\":true,\"title\":\"Debug mode\"},\"faucet\":{\"color\":\"#7099e6\",\"description\":\"Get some ETH\",\"has-handler\":false,\"name\":\"faucet\",\"params\":[{\"name\":\"url\",\"placeholder\":\"Faucet URL\",\"type\":\"text\"}],\"registered-only\":true,\"title\":\"Faucet\"},\"phone\":{\"color\":\"#5bb2a2\",\"description\":\"Find friends using your number\",\"has-handler\":false,\"icon\":\"phone_white\",\"name\":\"phone\",\"params\":[{\"name\":\"phone\",\"placeholder\":\"Phone number\",\"type\":\"phone\"}],\"registered-only\":true,\"sequential-params\":true,\"title\":\"Send Phone Number\"}},\"functions\":{},\"responses\":{\"confirmation-code\":{\"color\":\"#7099e6\",\"description\":\"Confirmation code\",\"has-handler\":false,\"name\":\"confirmation-code\",\"params\":[{\"name\":\"code\",\"type\":\"number\"}],\"sequential-params\":true},\"grant-permissions\":{\"color\":\"#7099e6\",\"description\":\"Grant permissions\",\"execute-immediately?\":true,\"has-handler\":false,\"icon\":\"lock_white\",\"name\":\"grant-permissions\",\"params\":[]},\"password\":{\"color\":\"#7099e6\",\"description\":\"Password\",\"has-handler\":false,\"icon\":\"lock_white\",\"name\":\"password\",\"params\":[{\"hidden\":true,\"name\":\"password\",\"placeholder\":\"Type your password\",\"type\":\"password\"},{\"hidden\":true,\"name\":\"password-confirmation\",\"placeholder\":\"Confirm\",\"type\":\"password\"}],\"sequential-params\":true},\"phone\":{\"color\":\"#5bb2a2\",\"description\":\"Find friends using your number\",\"has-handler\":false,\"icon\":\"phone_white\",\"name\":\"phone\",\"params\":[{\"name\":\"phone\",\"placeholder\":\"Phone number\",\"type\":\"phone\"}],\"registered-only\":true,\"sequential-params\":true,\"title\":\"Send Phone Number\"}},\"subscriptions\":{}}}")))
(callback "{\"result\":\"{\\\"commands\\\":{\\\"phone,50\\\":{\\\"name\\\":\\\"phone\\\",\\\"title\\\":\\\"Send Phone Number\\\",\\\"description\\\":\\\"Find friends using your number\\\",\\\"has-handler\\\":true,\\\"async-handler\\\":false,\\\"color\\\":\\\"#5bb2a2\\\",\\\"icon\\\":\\\"phone_white\\\",\\\"params\\\":[{\\\"name\\\":\\\"phone\\\",\\\"type\\\":\\\"phone\\\",\\\"placeholder\\\":\\\"Phone number\\\"}],\\\"sequential-params\\\":true,\\\"scope\\\":[\\\"personal-chats\\\",\\\"registered\\\",\\\"dapps\\\"],\\\"scope-bitmask\\\":50},\\\"faucet,50\\\":{\\\"name\\\":\\\"faucet\\\",\\\"title\\\":\\\"Faucet\\\",\\\"description\\\":\\\"Get some ETH\\\",\\\"has-handler\\\":true,\\\"async-handler\\\":false,\\\"color\\\":\\\"#7099e6\\\",\\\"params\\\":[{\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"text\\\",\\\"placeholder\\\":\\\"Faucet URL\\\"}],\\\"scope\\\":[\\\"personal-chats\\\",\\\"registered\\\",\\\"dapps\\\"],\\\"scope-bitmask\\\":50},\\\"debug,50\\\":{\\\"name\\\":\\\"debug\\\",\\\"title\\\":\\\"Debug mode\\\",\\\"description\\\":\\\"Starts\\/stops a debug mode\\\",\\\"has-handler\\\":true,\\\"async-handler\\\":false,\\\"color\\\":\\\"#7099e6\\\",\\\"params\\\":[{\\\"name\\\":\\\"mode\\\",\\\"type\\\":\\\"text\\\"}],\\\"scope\\\":[\\\"personal-chats\\\",\\\"registered\\\",\\\"dapps\\\"],\\\"scope-bitmask\\\":50}},\\\"responses\\\":{\\\"phone,50\\\":{\\\"name\\\":\\\"phone\\\",\\\"title\\\":\\\"Send Phone Number\\\",\\\"description\\\":\\\"Find friends using your number\\\",\\\"has-handler\\\":true,\\\"async-handler\\\":false,\\\"color\\\":\\\"#5bb2a2\\\",\\\"icon\\\":\\\"phone_white\\\",\\\"params\\\":[{\\\"name\\\":\\\"phone\\\",\\\"type\\\":\\\"phone\\\",\\\"placeholder\\\":\\\"Phone number\\\"}],\\\"sequential-params\\\":true,\\\"scope\\\":[\\\"personal-chats\\\",\\\"registered\\\",\\\"dapps\\\"],\\\"scope-bitmask\\\":50},\\\"confirmation-code,50\\\":{\\\"name\\\":\\\"confirmation-code\\\",\\\"description\\\":\\\"Confirmation code\\\",\\\"has-handler\\\":true,\\\"async-handler\\\":false,\\\"color\\\":\\\"#7099e6\\\",\\\"params\\\":[{\\\"name\\\":\\\"code\\\",\\\"type\\\":\\\"number\\\"}],\\\"sequential-params\\\":true,\\\"scope\\\":[\\\"personal-chats\\\",\\\"registered\\\",\\\"dapps\\\"],\\\"scope-bitmask\\\":50},\\\"password,42\\\":{\\\"name\\\":\\\"password\\\",\\\"description\\\":\\\"Password\\\",\\\"has-handler\\\":true,\\\"async-handler\\\":false,\\\"color\\\":\\\"#7099e6\\\",\\\"icon\\\":\\\"lock_white\\\",\\\"params\\\":[{\\\"name\\\":\\\"password\\\",\\\"type\\\":\\\"password\\\",\\\"placeholder\\\":\\\"Type your password\\\",\\\"hidden\\\":true},{\\\"name\\\":\\\"password-confirmation\\\",\\\"type\\\":\\\"password\\\",\\\"placeholder\\\":\\\"Confirm\\\",\\\"hidden\\\":true}],\\\"sequential-params\\\":true,\\\"scope\\\":[\\\"personal-chats\\\",\\\"anonymous\\\",\\\"dapps\\\"],\\\"scope-bitmask\\\":42},\\\"grant-permissions,58\\\":{\\\"name\\\":\\\"grant-permissions\\\",\\\"description\\\":\\\"Grant permissions\\\",\\\"has-handler\\\":true,\\\"async-handler\\\":false,\\\"color\\\":\\\"#7099e6\\\",\\\"icon\\\":\\\"lock_white\\\",\\\"params\\\":[],\\\"execute-immediately?\\\":true,\\\"scope\\\":[\\\"personal-chats\\\",\\\"anonymous\\\",\\\"registered\\\",\\\"dapps\\\"],\\\"scope-bitmask\\\":58}},\\\"functions\\\":{},\\\"subscriptions\\\":{}}\"}")))
(-call-jail [this {:keys [callback path] :as params}]
(cond
(= path [:responses "password" :preview])

View File

@ -7,7 +7,8 @@
[status-im.utils.types :refer [json->clj]]
[status-im.data-store.core :as data-store]
[status-im.native-module.core :as status]
[status-im.constants :refer [console-chat-id]]))
[status-im.constants :refer [console-chat-id]]
[status-im.utils.config :as config]))
;;;; FX
@ -27,8 +28,13 @@
(reg-fx
::change-account
(fn [[address new-account?]]
(data-store/change-account address new-account?
#(dispatch [:change-account-handler % address new-account?]))))
(js/setTimeout
(fn []
(data-store/change-account address new-account?
#(dispatch [:change-account-handler % address new-account?])))
;; if we don't add delay when running app without status-go
;; "null is not an object (evaluating 'realm.schema')" error appears
(if config/stub-status-go? 300 0))))
;;;; Handlers