Correctly dispatch on updates & disable them
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
parent
9dfb908678
commit
a64eb79065
|
@ -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]))})))))
|
||||||
|
|
|
@ -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)))
|
||||||
|
|
Loading…
Reference in New Issue