fixed help improve screen

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Andrey Shovkoplyas 2018-04-05 14:09:55 +03:00
parent df17c50612
commit e9af024e0d
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
1 changed files with 9 additions and 6 deletions

View File

@ -4,9 +4,12 @@
(handlers/register-handler-fx
:help-improve-handler
(fn [{db :db} [_ yes? address next]]
(merge (accounts/account-update {:sharing-usage-data? yes?} {:db db})
{:dispatch-n [(if yes?
[:register-mixpanel-tracking address]
[:unregister-mixpanel-tracking])
next]})))
(fn [{{:accounts/keys [accounts current-account-id] :as db} :db} [_ yes? address next]]
(let [{:keys [sharing-usage-data?]} (get accounts current-account-id)]
(merge (accounts/account-update {:sharing-usage-data? yes?} {:db db})
{:dispatch-n [(if yes?
[:register-mixpanel-tracking address]
(when (and next sharing-usage-data?)
[:unregister-mixpanel-tracking]))
(or next [:navigate-to-clean :home])]}))))