diff --git a/frontend/src/app/config.cljs b/frontend/src/app/config.cljs index b58876f97..b809f7e2e 100644 --- a/frontend/src/app/config.cljs +++ b/frontend/src/app/config.cljs @@ -143,6 +143,11 @@ (let [f (obj/get global "externalSessionId")] (when (fn? f) (f)))) +(defn external-context-info + [] + (let [f (obj/get global "externalContextInfo")] + (when (fn? f) (f)))) + ;; --- Helper Functions (defn ^boolean check-browser? [candidate] diff --git a/frontend/src/app/main/data/events.cljs b/frontend/src/app/main/data/events.cljs index 27001909a..56b41e6d3 100644 --- a/frontend/src/app/main/data/events.cljs +++ b/frontend/src/app/main/data/events.cljs @@ -93,6 +93,11 @@ 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 [event] (let [data (d/deep-merge (-data event) (meta event)) @@ -102,6 +107,7 @@ (assoc :event-origin (::origin data)) (assoc :event-namespace (namespace type)) (assoc :event-symbol ev-name) + (add-external-context-info) (d/without-nils)) props (-> data d/without-qualified simplify-props)] @@ -119,6 +125,7 @@ (let [type (::type data "action") context (-> (::context data) (assoc :event-origin (::origin data)) + (add-external-context-info) (d/without-nils)) props (-> data d/without-qualified simplify-props)] {:type type