1
0
Fork 0
mirror of https://github.com/voltbonn/profile-picture-generator.git synced 2024-12-21 23:35:05 +00:00

BUGFIX wrapped usage of window.umami in a check

This commit is contained in:
thomasrosen 2021-09-17 19:03:44 +02:00
parent f793d43254
commit 5b735aaf10
2 changed files with 7 additions and 5 deletions

View file

@ -71,7 +71,7 @@ function trigger_download(name, data){
function UmamiLink({ href, name, target, children, ...props }) {
const handleClick = useCallback(event => {
if (name) {
if (window.umami && name) {
window.umami.trackEvent('A: ' + name) // Log Anker / Link
}
@ -291,9 +291,11 @@ function App({ getString, locales, currentLocale, onLanguageChange }) {
const frameName = frame.name || 'No-Frame'
const hashtagName = hashtag.name || 'No-Hashtag'
window.umami.trackEvent('F: ' + frameName) // Log Frame
window.umami.trackEvent('H: ' + hashtagName) // Log Hashtag
window.umami.trackEvent('C: ' + [frameName, hashtagName].join(' | ')) // Log Combined
if (window.umami) {
window.umami.trackEvent('F: ' + frameName) // Log Frame
window.umami.trackEvent('H: ' + hashtagName) // Log Hashtag
window.umami.trackEvent('C: ' + [frameName, hashtagName].join(' | ')) // Log Combined
}
})
}

View file

@ -12,7 +12,7 @@ function AppLanguageWrapper() {
useEffect(() => {
let systemLocales = navigator.languages
if (!!systemLocales || Array.isArray(systemLocales)) {
if (window.umami && (!!systemLocales || Array.isArray(systemLocales))) {
for (const locale of systemLocales) {
window.umami.trackEvent('L: ' + locale) // Log Locale / Languages
}