mirror of
https://github.com/penpot/penpot.git
synced 2025-01-07 15:39:42 -05:00
✨ Add feature flags info to posthog events
This commit is contained in:
parent
3eab9da74e
commit
3dc564d21f
2 changed files with 12 additions and 0 deletions
|
@ -143,6 +143,11 @@
|
||||||
(let [f (obj/get global "externalSessionId")]
|
(let [f (obj/get global "externalSessionId")]
|
||||||
(when (fn? f) (f))))
|
(when (fn? f) (f))))
|
||||||
|
|
||||||
|
(defn external-context-info
|
||||||
|
[]
|
||||||
|
(let [f (obj/get global "externalContextInfo")]
|
||||||
|
(when (fn? f) (f))))
|
||||||
|
|
||||||
;; --- Helper Functions
|
;; --- Helper Functions
|
||||||
|
|
||||||
(defn ^boolean check-browser? [candidate]
|
(defn ^boolean check-browser? [candidate]
|
||||||
|
|
|
@ -93,6 +93,11 @@
|
||||||
data
|
data
|
||||||
data))
|
data))
|
||||||
|
|
||||||
|
(defn add-external-context-info
|
||||||
|
[context]
|
||||||
|
(let [external-context-info (js->clj (cf/external-context-info) :keywordize-keys true)]
|
||||||
|
(merge context external-context-info)))
|
||||||
|
|
||||||
(defn- process-event-by-proto
|
(defn- process-event-by-proto
|
||||||
[event]
|
[event]
|
||||||
(let [data (d/deep-merge (-data event) (meta event))
|
(let [data (d/deep-merge (-data event) (meta event))
|
||||||
|
@ -102,6 +107,7 @@
|
||||||
(assoc :event-origin (::origin data))
|
(assoc :event-origin (::origin data))
|
||||||
(assoc :event-namespace (namespace type))
|
(assoc :event-namespace (namespace type))
|
||||||
(assoc :event-symbol ev-name)
|
(assoc :event-symbol ev-name)
|
||||||
|
(add-external-context-info)
|
||||||
(d/without-nils))
|
(d/without-nils))
|
||||||
props (-> data d/without-qualified simplify-props)]
|
props (-> data d/without-qualified simplify-props)]
|
||||||
|
|
||||||
|
@ -119,6 +125,7 @@
|
||||||
(let [type (::type data "action")
|
(let [type (::type data "action")
|
||||||
context (-> (::context data)
|
context (-> (::context data)
|
||||||
(assoc :event-origin (::origin data))
|
(assoc :event-origin (::origin data))
|
||||||
|
(add-external-context-info)
|
||||||
(d/without-nils))
|
(d/without-nils))
|
||||||
props (-> data d/without-qualified simplify-props)]
|
props (-> data d/without-qualified simplify-props)]
|
||||||
{:type type
|
{:type type
|
||||||
|
|
Loading…
Reference in a new issue