From e3ec4757b758375f4e40d08d51b6502c0e91e4d5 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Thu, 20 Oct 2016 15:01:50 +0300 Subject: [PATCH] fixes #368 Former-commit-id: 2c72274025a3f8ea3866dd337571d0777b9b467e --- src/status_im/protocol/handlers.cljs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/status_im/protocol/handlers.cljs b/src/status_im/protocol/handlers.cljs index 0689bbd375..be0d8388f6 100644 --- a/src/status_im/protocol/handlers.cljs +++ b/src/status_im/protocol/handlers.cljs @@ -63,12 +63,12 @@ (register-handler :initialize-sync-listener (fn [{:keys [web3 sync-listener] :as db} _] - (when sync-listener - (.stopWatching sync-listener)) - (->> (.isSyncing (.-eth web3) - (fn [error sync] - (dispatch [:update-sync-state error sync]))) - (assoc db :sync-listener)))) + (if-not sync-listener + (->> (.isSyncing (.-eth web3) + (fn [error sync] + (dispatch [:update-sync-state error sync]))) + (assoc db :sync-listener)) + db))) (register-handler :incoming-message (u/side-effect!