Skip to content

Commit

Permalink
chore: improve demo analytics for copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Justineo committed Sep 14, 2023
1 parent ccb951e commit 21fae71
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/demo/CodeGen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ watch(
}
);
const copied = ref(false);
const initializing = ref(true);
const optionCode = ref("");
const transformedCode = ref("");
Expand Down Expand Up @@ -136,13 +137,22 @@ const importCode = computed(() => {
}
});
watch(importCode, () => {
copied.value = false;
});
// copy message
const messageOpen = ref(false);
let messageTimer;
function trackCopy(from) {
if (copied.value) {
// only track copy after modifications
return;
}
copied.value = true;
track("copy-code", { from });
console.log("copied");
}
function copy() {
Expand Down

1 comment on commit 21fae71

@vercel
Copy link

@vercel vercel bot commented on 21fae71 Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.