fix: handly empty growth endpoint

This commit is contained in:
Torsten Dittmann
2023-02-08 12:00:09 +01:00
parent 0d1377e7db
commit d2e24c4de6
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -34,8 +34,9 @@ export function trackPageView(path: string) {
}
function sendEventToGrowth(event: string, path: string, data: object = null): void {
let email: string, name: string;
if (!growthEndpoint) return;
const userStore = get(user);
let email: string, name: string;
if (userStore) {
email = userStore.email;
name = userStore.name;
+1
View File
@@ -60,6 +60,7 @@ function createFeedbackStore() {
email?: string,
value?: number
) => {
if (!growthEndpoint) return;
const response = await fetch(`${growthEndpoint}/feedback`, {
method: 'POST',
headers: {