Log closed event from background.cljs instead of content.cljs
This commit is contained in:
parent
0ea66897d4
commit
bb99c1a33d
@ -3,6 +3,7 @@
|
||||
[ajax.core :refer [GET]]
|
||||
[goog.string :as gstring]
|
||||
[looped-in.hackernews :as hn]
|
||||
[looped-in.analytics :as analytics]
|
||||
[looped-in.logging :as log]
|
||||
[looped-in.promises :refer [channel->promise promise->channel]]))
|
||||
|
||||
@ -85,7 +86,8 @@
|
||||
"hits" (channel->promise (go @hits))
|
||||
"fetchItem" (channel->promise
|
||||
(go (clj->js (<! (hn/fetch-item (.-id msg))))))
|
||||
"getUserId" (channel->promise (get-user-id))))
|
||||
"getUserId" (channel->promise (get-user-id))
|
||||
"logEvent" (analytics/log-event (.-eventType msg) (.-eventProperties msg))))
|
||||
|
||||
(-> js/browser
|
||||
(.-tabs)
|
||||
@ -107,3 +109,4 @@
|
||||
(.-onMessage)
|
||||
(.addListener handle-message))
|
||||
|
||||
(analytics/init-amplitude)
|
||||
|
@ -35,7 +35,8 @@
|
||||
(defn close-sidebar []
|
||||
(let [$html (.-documentElement js/document)
|
||||
$sidebar (dom/getElement "loopedInSidebar")]
|
||||
(analytics/log-event "CLOSED_SIDEBAR")
|
||||
(-> js/browser (.-runtime) (.sendMessage (clj->js {:type "logEvent"
|
||||
:eventType "CLOSED_SIDEBAR"})))
|
||||
(dom/removeNode $sidebar)
|
||||
(set! (-> $html (.-style) (.-paddingLeft)) @old-html-padding)))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user