use addEvent everywhere
This commit is contained in:
parent
adbc459347
commit
64789d1c29
@ -166,7 +166,7 @@ function App() {
|
||||
toast.error(
|
||||
"No parent version set. Contact support or open a Github issue."
|
||||
);
|
||||
window.plausible("ParentVersionNull");
|
||||
addEvent("ParentVersionNull");
|
||||
return prev;
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import {
|
||||
SelectTrigger,
|
||||
} from "./ui/select";
|
||||
import { GeneratedCodeConfig } from "../types";
|
||||
import { addEvent } from "../lib/analytics";
|
||||
|
||||
function generateDisplayComponent(config: GeneratedCodeConfig) {
|
||||
switch (config) {
|
||||
@ -62,7 +63,7 @@ function OutputSettingsSection({
|
||||
<Select
|
||||
value={generatedCodeConfig}
|
||||
onValueChange={(value: string) => {
|
||||
window.plausible("OutputSettings", { props: { stack: value } });
|
||||
addEvent("OutputSettings", { stack: value });
|
||||
setGeneratedCodeConfig(value as GeneratedCodeConfig);
|
||||
}}
|
||||
disabled={shouldDisableUpdates}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export function addEvent(eventName: string) {
|
||||
export function addEvent(eventName: string, props = {}) {
|
||||
try {
|
||||
window.plausible(eventName);
|
||||
window.plausible(eventName, { props });
|
||||
} catch (e) {
|
||||
// silently fail in non-production environments
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user