Correctly dispatch on updates & disable them

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2020-01-28 13:57:23 +01:00
parent 9dfb908678
commit a64eb79065
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
(ns status-im.multiaccounts.update.publisher (ns status-im.multiaccounts.update.publisher
(:require [taoensso.timbre :as log] (:require [taoensso.timbre :as log]
[re-frame.core :as re-frame]
[status-im.constants :as constants] [status-im.constants :as constants]
[status-im.multiaccounts.update.core :as multiaccounts] [status-im.multiaccounts.update.core :as multiaccounts]
[status-im.ethereum.json-rpc :as json-rpc] [status-im.ethereum.json-rpc :as json-rpc]
@ -25,4 +26,9 @@
(log/debug "sending contact updates") (log/debug "sending contact updates")
(json-rpc/call {:method "shhext_sendContactUpdates" (json-rpc/call {:method "shhext_sendContactUpdates"
:params [(or preferred-name name) photo-path] :params [(or preferred-name name) photo-path]
:on-success #(log/debug "sent contact updates")}))))) :on-failure #(do
(log/warn "failed to send contact updates")
(re-frame/dispatch [:multiaccounts.update.callback/failed-to-publish]))
:on-success #(do
(log/debug "sent contact updates")
(re-frame/dispatch [:multiaccounts.update.callback/published]))})))))

View File

@ -20,7 +20,6 @@
(let [cofx {:now (datetime/timestamp) (let [cofx {:now (datetime/timestamp)
:db @re-frame.db/app-db}] :db @re-frame.db/app-db}]
(mailserver/check-connection!) (mailserver/check-connection!)
(multiaccounts/publish-update! cofx)
(done-fn))) (done-fn)))
sync-interval-ms sync-interval-ms
sync-timeout-ms))) sync-timeout-ms)))