aboutsummaryrefslogtreecommitdiff
path: root/src/cljs/gnunet_web/transport.cljs
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amatus.name>2014-08-20 21:27:35 -0500
committerDavid Barksdale <amatus@amatus.name>2014-08-20 21:27:35 -0500
commit7229075045972147d11f23dc02c68e0553bc4094 (patch)
tree534cc09cbd26277056ac66a584cbde7f18bd1161 /src/cljs/gnunet_web/transport.cljs
parentdae2186cb8be4c1975244fc7dbf6220e971993bf (diff)
Show core KX state along with transport state
Diffstat (limited to 'src/cljs/gnunet_web/transport.cljs')
-rw-r--r--src/cljs/gnunet_web/transport.cljs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cljs/gnunet_web/transport.cljs b/src/cljs/gnunet_web/transport.cljs
index e39cece..c9c420c 100644
--- a/src/cljs/gnunet_web/transport.cljs
+++ b/src/cljs/gnunet_web/transport.cljs
@@ -76,7 +76,7 @@
(fn [event]
(let [message (.-v ((parse-message-types #{parse-hello})
(.-data event)))]
- (if (not (= :nothing message))
+ (if (coll? message)
(callback (:message (first message)))))))
(client-connect "transport" "web app (monitor)"
(.-port2 message-channel))
@@ -88,10 +88,11 @@
(let [message-channel (js/MessageChannel.)]
(set! (.-onmessage (.-port1 message-channel))
(fn [event]
- (let [message (first (.-v ((parse-message-types
- #{parse-peer-iterate-reply})
- (.-data event))))]
- (callback (:message message)))))
+ (let [message (.-v ((parse-message-types
+ #{parse-peer-iterate-reply})
+ (.-data event)))]
+ (if (coll? message)
+ (callback (:message (first message)))))))
(client-connect "transport" "web app (monitor-peers)"
(.-port2 message-channel))
(.postMessage (.-port1 message-channel)