1
0
Эх сурвалжийг харах

enhance: check instrument payload

rcmerci 2 жил өмнө
parent
commit
ed972ccd8d

+ 3 - 1
src/main/frontend/handler/events.cljs

@@ -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]}]]