Fix some typos in develop

This commit is contained in:
janherich 2017-11-06 16:17:03 +01:00 committed by Roman Volosovskyi
parent a995f73638
commit 40e006ef00
2 changed files with 43 additions and 48 deletions

View File

@ -59,8 +59,8 @@
(defn stop-listening-confirmation-code-sms [{:keys [db] :as fx}]
(-> fx
(update db dissoc :confirmation-code-sms-listener)
(update ::remove-sms-listener assoc (:confirmation-code-sms-listener db))))
(update :db dissoc :confirmation-code-sms-listener)
(assoc ::remove-sms-listener (:confirmation-code-sms-listener db))))
(re-frame/reg-fx
::remove-sms-listener
@ -81,7 +81,7 @@
(handlers/register-handler-fx
::sign-up-success
[re-frame/trim-v (re-frame/inject-cofx :random-id)]
(fn [{:keys [db random-id]} message-id]
(fn [{:keys [db random-id]} [message-id]]
(-> {:db db
:dispatch-n [;; create manual way for entering confirmation code
(sign-up/enter-confirmation-code-event random-id)
@ -103,17 +103,14 @@
(sign-up-confirm db confirmation-code message-id)))
(defn- sign-up-confirmed [{:keys [db] :as fx} now]
(let [last-phone-number (extract-last-phone-number (:chats db))]
(cond->
(stop-listening-confirmation-code-sms fx)
true
(update :dispatch-n conj [:request-permissions [:read-contacts]
(let [last-phone-number (extract-last-phone-number (:chats db))
fx (-> (stop-listening-confirmation-code-sms fx)
(update :dispatch-n conj
[:request-permissions [:read-contacts]
#(re-frame/dispatch [:sync-contacts (fn [contacts]
[::contacts-synced contacts])])])
last-phone-number
(accounts-events/account-update {:phone last-phone-number
[::contacts-synced contacts])])]))]
(cond-> fx
last-phone-number (accounts-events/account-update {:phone last-phone-number
:last-updated now}))))
(handlers/register-handler-fx

View File

@ -162,16 +162,14 @@
{:dispatch [:broadcast-status status hashtags]}))))))
(defn account-update
"Takes map of coeffects containing `:db` and `:now` keys + new account fields,
returns all effects necessary for account update."
"Takes effects (containing :db) + new account fields, adds all effects necessary for account update."
[{{:accounts/keys [accounts current-account-id] :as db} :db :as fx} new-account-fields]
(let [current-account (get accounts current-account-id)
new-account (merge current-account new-account-fields)]
(-> fx
(assoc-in [:db :accounts/accounts current-account-id] new-account)
(assoc ::save-account new-account)
(assoc ::broadcast-account-update (merge
(select-keys db [:current-public-key :web3])
(assoc ::save-account new-account
::broadcast-account-update (merge (select-keys db [:current-public-key :web3])
(select-keys new-account [:name :photo-path :status
:updates-public-key :updates-private-key]))))))