Skip to content

Commit

Permalink
Merge pull request #1905 from frappe/develop
Browse files Browse the repository at this point in the history
dev to main
  • Loading branch information
RitvikSardana authored Aug 7, 2024
2 parents ebc202e + a6652a2 commit fa1519f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
15 changes: 8 additions & 7 deletions desk/src/pages/TicketNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ const ticket = createResource({
}
},
onSuccess: (data) => {
if (isCustomerPortal) return;
router.push({
name: route.meta.onSuccessRoute as string,
params: {
ticketId: data.name,
},
});
if (!isCustomerPortal) return;
// only capture telemetry for customer portal
capture("new_ticket_submitted", {
data: {
user: userID,
Expand All @@ -156,12 +163,6 @@ const ticket = createResource({
customFields: templateFields,
},
});
router.push({
name: route.meta.onSuccessRoute as string,
params: {
ticketId: data.name,
},
});
},
onError: useError(),
});
Expand Down
5 changes: 4 additions & 1 deletion desk/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ interface CaptureOptions {
};
}

export function capture(event: string, options: CaptureOptions = { data: {} }) {
export function capture(
event: string,
options: CaptureOptions = { data: { user: "" } }
) {
if (!telemetry.value.enabled) return;
window.posthog.capture(`${APP}_${event}`, options);
}
Expand Down

0 comments on commit fa1519f

Please sign in to comment.