Skip to content

Commit

Permalink
enhance: check instrument payload
Browse files Browse the repository at this point in the history
  • Loading branch information
RCmerci authored and tiensonqin committed Nov 23, 2022
1 parent daf4425 commit ed972cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/frontend/handler/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,9 @@
(defmethod handle :redirect-to-home [_]
(page-handler/create-today-journal!))

(defmethod handle :instrument [[_ {:keys [type payload]}]]
(defmethod handle :instrument [[_ {:keys [type payload] :as opts}]]
(when-not (empty? (dissoc opts :type :payload))
(js/console.error "instrument data-map should only contains [:type :payload]"))
(posthog/capture type payload))

(defmethod handle :exec-plugin-cmd [[_ {:keys [pid cmd action]}]]
Expand Down

0 comments on commit ed972cc

Please sign in to comment.