diff --git a/src/status_im/chat/handlers.cljs b/src/status_im/chat/handlers.cljs index 7ea23394ae..66af0acf7c 100644 --- a/src/status_im/chat/handlers.cljs +++ b/src/status_im/chat/handlers.cljs @@ -1,5 +1,7 @@ -(ns status-im.chat.handlers - (:require [re-frame.core :refer [enrich after debug dispatch reg-fx]] +(ns status-im.chat.handlers + (:require-macros [cljs.core.async.macros :as am]) + (:require [re-frame.core :refer [enrich after debug dispatch reg-fx]] + [cljs.core.async :as a] [clojure.string :as string] [status-im.ui.components.styles :refer [default-chat-color]] [status-im.chat.constants :as chat-consts] diff --git a/src/status_im/native_module/impl/module.cljs b/src/status_im/native_module/impl/module.cljs index 58fe3b5cd6..6e645190ef 100644 --- a/src/status_im/native_module/impl/module.cljs +++ b/src/status_im/native_module/impl/module.cljs @@ -6,7 +6,8 @@ [taoensso.timbre :as log] [cljs.core.async :as async :refer [pending-message (atom {})) -(def ^:private pending-message-queue (async/chan 100)) +(defn set-pending-mesage-callback! + [callback] + (reset! pending-message-callback callback)) -(async/go-loop [[web3 {:keys [type message-id requires-ack? to ack?] :as message}] - (async/pending-message - update to set/union #{[web3 message-id to]})))))) - (recur (async/pending-message to)] diff --git a/src/status_im/utils/event.cljs b/src/status_im/utils/event.cljs new file mode 100644 index 0000000000..25e1775b99 --- /dev/null +++ b/src/status_im/utils/event.cljs @@ -0,0 +1,9 @@ +(ns status-im.utils.event + (:require [cljs.core.async :refer [> seen (filter (fn [[_ x]] (= x id))) @@ -26,8 +30,7 @@ (async/go-loop [] (let [{:keys [id clock-value] :as msg} (async/ms [s] (* 1000 s)) + +(defn execute-later + [function timeout-ms] + (go (