Skip to content

Commit

Permalink
fix: don't crash when umami isnt present
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Dec 26, 2024
1 parent b82f117 commit d8dddae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/composables/useTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function track(type: string, elementName: MaybeRefOrGetter<string>, addit
data[k] = toValue(v);
}
data["type"] = type;
window.umami.track(name, data);
window.umami?.track(name, data);
}

export function identify() {
Expand All @@ -26,5 +26,5 @@ export function identify() {
props.user = authStore.user ? authStore.user.name : "<anonymous>";
props.theme = settingsStore.darkMode ? "dark" : "light";
props.language = i18n.locale.value;
window.umami.identify(props);
window.umami?.identify(props);
}

0 comments on commit d8dddae

Please sign in to comment.